Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Forum
Search
Topic Display XML tags in font.draw By EdwinOdesseiron Date 2015-01-02 18:41
Not sure if it'll work, and can't check atm, but wouldn't \<c> work?
Topic Alternate Solutions to Multiple Windows? By EdwinOdesseiron Date 2014-06-17 22:15
There is a way to change screen resolution without having 2+ separate Gosu::Window implementations. I've done it in my game, for switching between fullscreen and windowed mode (but it works with resolution as well - checked that). Basically you either create global variables with size ($game_width, $game_height), or add arguments to GameWindow < Gosu::Window initialize. When you create a window, make it global too, so when you first create it, you do it like that:
$window = GameWindow.new(800,600) #w,h
$window.show

# GameWindow's initialize method:
def initialize(width, height)
super(width, height, false)
...
end

Then, let's say in your options menu, you have the option to change the resolution to 1024x768. To make it work, you can simply use this:
$window.close
$window = GameWindow.new(1024,768)
$window.show


And it will restart your window with new size. You may further alter it to open with certain things on, ie. in Die Erlösung I made the window to take one argument - target (a Symbol), and depending on the target, we're sent to either a Intro/Splash, Title screen or Settings screen. So there's plenty of possibilities.
Topic Series of tutorials on how to make a Platformer game in Gosu By EdwinOdesseiron Date 2014-05-25 21:09
2 more tutorials are up!
Topic Galaga++ By EdwinOdesseiron Date 2014-05-12 23:09
It's really good! I got to 14th level and died :c I found no problem with the game at all - everything works really smooth, nothing seems out of sync etc. I'm actually amazed by it.
Topic Series of tutorials on how to make a Platformer game in Gosu By EdwinOdesseiron Date 2014-05-11 17:44
Hi all, recently I've started working on a weekly tutorial series on how to make a platform game in Gosu w/ Ruby (in English). Only 2 tutorials are up at the moment, but I've already done 8 in Polish (you can find them here). I thought that this will be the best place to post about them ;)

They're up on my website, under "Creating a platformer in Ruby". Let me know what do you think about them!

At the moment I have ~13 tutorials planned out, I might do more though.
Topic Furry Dangerzone By EdwinOdesseiron Date 2014-04-21 13:14
There's a Gosu::fps function? I wrote a code just to do that ;_;
Topic Die Erlösung - Redemption. A horror Adventure/RPG game By EdwinOdesseiron Date 2014-04-15 09:03
I've got three people who will do the first, main tests (one of them is a gamedev as well, so he'll be able to look at things from technical side). I'll probably also release tech-demo after first tests and removing major bugs, mainly to show how is the game going to be played and get an insight on performance on other computers. I have a piece of code just for it - constantly saves an average FPS from 10 seconds, when size of average FPS array reaches 50 it gets averaged again and saved on index 0, repeat. At exit it again calculates full average and saves it into file. I think it doesn't put much stress on memory, since it's just 2 arrays, one with 10 floats, and another one with 50 floats.
Topic Die Erlösung - Redemption. A horror Adventure/RPG game By EdwinOdesseiron Date 2014-04-14 20:40
Oh god, an update. After a looooong time.

Couple of things has happened over the time. I'll try to outline the changes as good as I can.

First of all, I had encountered a couple of problems with my code, which resulted in me rewriting quite a bunch of it. It should speed it up a bit, but I think I'll have to optimize the code further when engine is done and dusted. Most of the things work pretty much the same, so no point in getting into it really much.

=> Some menus have changed, instead of being a separate scene they're now all displayed over a map. IMO it looks slightly better, definitely a better idea than having everything displayed and a lot of "whitespace" in widescreen mode.
=> Settings are now saved in an .ini file, instead of being Marshal.dump'd. Makes life easier. Settings also have increased slightly, main additions are Autopause and Interaction options. You also have the option to change your language (Polish/English, maybe more in the future [if I'll get someone to translate it]). Accessible both in Game and with ini file (in game change requires full restart, obviously).
=> Editor, which took me a lot of time, is pretty much done. It's mainly making my life easier, but it's worth a note.
=> Some more options within inventory added: back in a day Right-click over an item gave you description. Now it actually gives you options to See Description, Drop Item or (with guns), Unload a gun. Think S.T.A.L.K.E.R.
=> Pathfinding is still crapish, with a bit of improvements: Active search (with option to turn that off on slower computers) which re-creates a path every step. Also there's a series of 'PFpointers' on each map that will be a default target if original target is not reachable. Fixes the problem with either characters going to a wall/doors/any_other_obstacle (with Active PF off) or stopping in a place (with Active PF on). Still needs some tweaks, but it's fairly stable at the moment.

As of what's to be done, I only have a handful stuff that needs creating. How long will it take? I can't tell, I'm fairly sure I'll encounter some problems along the way.
=> Finish all 'entity' types; there's only 2 remaining now - Waypoint (doors/teleporter/whatelse) and Container (drawer/bag/etc). When I'll create a Container (working), I'll tweak Inventory around, so if player gets an item with bag full, it gets dropped.
=> Battle Engine: this is going to be alot of work. I will have to take care of quite a few things, I've got some ideas on how it's going to work out, hopefully it'll be as close to perfect as it gets :)
=> Load/Save - I'm leaving that to be last thing, because it's gonna have to store quite a few things, some of which aren't yet finished.

Next thing I wanted to say is that I pretty much decided on what different Difficulties will do. Again, it's not set in stone, so all suggestions are more than welcome!
Easy:  Standard damage.
Normal: Getting hit in the head deals double damage; some wounds will bleed* for around 2 seconds.
Hard: Getting hit in the head is an insta-killl; wounds will bleed for 10 seconds, or until treated**
Cthulthist: Getting hit in the head is an insta-kill, wounds won't stop bleeding until they're treated, using alcohol on a wound will deal some psychic damage (refer to earlier posts), and may also knock the character unconscious for a moment; any wound that'll deal over half of our Max HP causes our character to Panic (run around and do nothing pretty much).

* Bleeding will deal a damage over time - depending on how heavy the bleeding is
** Treating a wound: Stops bleeding, and some things may slightly heal our character. Though healing only works to a certain point - you can heal up to 33% of lowest health you had. What does it mean? Lets say you had 100HP, then you got some damage and your health dropped do 48HP. That's the lowest health you got to - you can only heal yourself to 64HP (lowest point [48] + 1/3 of this point [16]). If you get wounded again and your health drops to below 48, you can heal even less. This essentially will get rid of insta-healing to full HP in a matter of seconds.

And last, but not least, I've 'made' a small 'website' related to this (and any future/parallel) project(s) I have. I try to update it weekly, so if anyone's interested in getting news about this project (a bit more often than I post here, sorry), head to http://corruptgd.wordpress.com!
Topic How many sounds can be played in parallel? By EdwinOdesseiron Date 2014-01-27 21:56
Too bad. I guess I'll have to find a workaround for that. Probably a couple of Samples played at random intervals will work good enough.
Topic How many sounds can be played in parallel? By EdwinOdesseiron Date 2014-01-27 08:38
Only one song at a time? Damn, there goes my background ambient :c
Topic Help with pathfinding:find closest path if cant reach target By EdwinOdesseiron Date 2013-12-06 17:29
(Tried to fit thread into given space)

Hi all. I've slightly upgraded my pathfinding, so that it actively searches path between points. This has one pro, and one con:
Pro => is that the path is constantly refreshed; moving objects won't make player suddenly block or glitch
Con => when walking, if one of other moving objects (ex. other player character) blocks only way to reach the target, player stops and pathfinding gets erased. And I have a problem with that thing.

I reckon upgrading path finding in the way that whenever path can't be created, it looks for a closest reachable point and returns path to this point. This wouldn't be that hard to do (if path can't be created, just calculate approximate distance between path ends and target), but the problem is that my pathfinding (script below) works "backwards" - it goes from target to start point. This creates the problem that the "nearest point to target" (in this case: player) will be unreachable.

Thanks to a friend I've found one way I could kind of fix it - series of "waypoints" to which player would go (ofc. closest to target) if he can't reach the target itself. I guess it will work, but if anyone could help me with making it more advanced (so finding nearest available point and walking towards it) I would be really grateful.

My pathfinding code is here:
def get_path(sx, sy, ex, ey)
    map = []
    for y in 0...@map_size[0]
      map[y] = []
      for x in 0...@map_size[1]
        map[y][x] = 0
      end
    end
    map[ey][ex] = 1
    old_positions = []
    new_positions = []
    old_positions << [ex, ey]
    depth = 2
    depth.upto(100) { |step|
      loop do
        break if old_positions[0] == nil
        x, y = old_positions.shift
        return [true, map, step] if x == sx and y + 1 == sy
        if passable?(x, y + 1) and map[y+1][x] == 0 then
          map[y+1][x] = step
          new_positions << [x, y+1]
        end
        return [true, map, step] if x-1 == sx and y == sy
        if passable?(x - 1,y) and map[y][x-1] == 0 then
          map[y][x-1] = step
          new_positions << [x-1, y]
        end
        return [true, map, step] if x+1 == sx and y == sy
        if passable?(x + 1,y) and map[y][x + 1] == 0 then
          map[y][x + 1] = step
          new_positions << [x+1, y]
        end
        return [true, map, step] if x == sx and y - 1 == sy
        if passable?(x, y - 1) and map[y-1][x] == 0 then
          map[y-1][x] = step
          new_positions << [x, y-1]
        end
      end
      old_positions = new_positions
      new_positions = []
    }
    return [false, nil, nil]
  end


And explanation - algorithms looks around the given tile, and assigns each surrounding tile a number (i+1, starting at 0). This keeps going on, until it reaches player. Then it returns the path path = [boolean: path_finished?, [map], current_step] which player follows (goes from a to b, where b = a - 1. Fairly simple, but it works.

Thanks a lot for any help =)
Topic Need help converting coordinates into tile_x/y in iso view By EdwinOdesseiron Date 2013-11-14 19:46
Hi all. I encountered a problem that I can't seem to get my head around to make it work.

I've made a few changes, and one of them was putting a game into isometric view. Some things work great, but I have a problem calculating player's tile_x and tile_y position on isometric grid.

The grid is drawn this way:
cx = x * 32 # x * tile_width/2
cy = y * 32 # y * tile_height
isoX = cx - cy
isoY = (cx + cy) / 2
@tileset[@tiles[l][y][x]].draw(isoX + @offset_x + @hud_offset, isoY + @offset_y, l)


And it works well. But I can't seem to get my head around putting players on correct positions. I tried with this code:
@x = (tile_x * 32) - (tile_y*32)
@y = ((tile_x * 32) + (tile_y * 32) / 2) - @sprite.height

While sending player characters to tiles: {4:3}, {3:4}, {4:2} and {2:3}, and according to prints, they are at correct positions, but when I displayed tile x and y, they seem to be a bit off (2-3 tiles).
And another problem is that I can't seem to correctly calculate @tile_x and @tile_y position of player when I have their @x and @y. When printing, I get this data:
Player 0 placed at 4:3
Updating
Player 0 at 2:3
===
Player 1 placed at 3:4
Updating
Player 1 at 1:3
===
Player 2 placed at 4:2
Updating
Player 2 at 2:2
===
Player 3 placed at 2:3
Updating
Player 3 at 0:2

with calculations:
@tile_x = ((@x / 32) + (@y / 32)) / 2
@tile_y = ((@y / 16) - (@x / 32)) / 2

Which, again, gives off different values. Anyone have any clues how to calculate @x and @y when passing tile_x and tile_x and vice versa, calculating @tile_x and @tile_y when passing x and y?

Dimensions of single tiles are 64x32, and player sprite is 64x64. Thanks in advance.
Topic Forking update and draw to separate Processes/threads? By EdwinOdesseiron Date 2013-10-17 09:44
Is there an easy, effective way to fork Gosu process into two, having update and draw run as another thread? This could probably increase efficiency on 2+core processors, as these two things could run parallel to each other, using separate cores.
Topic How to clear image in main window? By EdwinOdesseiron Date 2013-10-16 15:17
We've all been :)
Topic How to clear image in main window? By EdwinOdesseiron Date 2013-10-14 19:16
@image = nil will "delete" the image, but that will cause problems when drawing. You could change your draw to @image.draw(@x,@y,1) if @image != nil.
Topic Die Erlösung - Redemption. A horror Adventure/RPG game By EdwinOdesseiron Date 2013-09-24 23:15
Small update to first post, since I didn't update for some time. There's not much done, as I pretty much didn't have time since about mid-July until the end of August, but I'm still working on the project! ;)

What I added to first post:
- Particle Engine: both for continuous animation (like fire, smoke, water leaking from pipe) and single animations (explosion, blood shooting out when shot, smoke from gun after shooting).
- Re-designed HUD, it now fits nicely on one (left) side of screen!
- Animated intro (2 short "video clips", one displaying "Powered by Ruby and Gosu", seconds shows my creator's logo), of course it can be skipped
- When player's resolution is the same, or smaller than game resolution (that is 1024x768 or 1366x768), he or she is prompted that window is scaled down and some graphic may look glitchy, and that it is advised to turn on full-screen mode in Settings.


I also started working on game editor, to make my life easier. This editor will both create maps (probably I'll save them with Marshal.dump) with all changes the map may have over game-time (more below), as well as it'll edit and create some game assets: Particle Effects, NPCs, Items and Enemies. These will be most likely saved in plain text file, as I'll later put them in the code. I've attached a early screenshot of Assets Editor, showing 4 sub-windows:
- Menu Bar (empty, will contain new, save, open etc)
- Asset List - shows all assets in nice drop down list (it works!)
and 2 more windows, all related to particles
- Particle Preview - will display particle animation. Updated in real time, so all changes will be easily seen
- Particle Creator - will contain hell a lot of sliders that allow adjusting pretty much every aspect of particles

And as for what changes maps might have during games, I thought about some small, mainly cosmetic changes, such as after grenade explosion small area on the floor and walls may be darker, because of burn, or when player/enemy gets shot his blood may show up on wall and floor. This shouldn't be hard to do (pretty much swapping @tiles[x][y] with different tile and saving it), but I most likely won't bother with it until the engine is nearly finished.
Attachment: 23_AssetEditor02.png (53k)
Topic Which is faster? By EdwinOdesseiron Date 2013-09-11 20:12
I've got a small question regarding performance. Since Fog of War in my project is based on 32x32 tiles, I use a single .png graphic, completely black. It's 2.75kb in size.
I draw it in 2 states: with alpha set to 255 and 128, depending on what did player see. At most, there are 1,248 of these tiles drawn on screen (if player is looking at the part of map which has no player characters on). I was wondering, if replacing:
@sprite = Image.new($window, "Graphics/Sprites/fow_frame.png", false)
with:
@sprite = $window.record { $window.draw_quad(x, y, @color, x + 32, y, @color, x + 32, y + 32, @color, x, y+32, @color, Z::FOW) }
Would be faster? I would like to use a bit smaller grid, but halving both width and height of single FOW tile (to 16x16) increases amount of tiles being drawn 4 times, which drops FPS really bad.

Also I wouldn't mind some good alternatives on creating FOW effect.
Topic Suggestions on how to implement syntax highlighting By EdwinOdesseiron Date 2013-09-09 16:14
I guess these 2 places (Image#from_text and Font#draw) are suitable for this. Small note that it allows the use of XML's <c>,<u>,<i> and what else tags. Definitely better than no information at all, I'd say.
Topic Suggestions on how to implement syntax highlighting By EdwinOdesseiron Date 2013-09-09 12:05
Personally I think this should be included in Gosu documentation. I had no idea I can use XML tags, and it really made my life easier. By the time it was posted I had a separate line colouring in chatlog system implemented, and I was wondering how to implement a single word colouring. It saved me hours of coding and trying various approaches.
Topic Is there actual documentation for gosu? By EdwinOdesseiron Date 2013-08-28 11:52
Agree on renaming factor to scale, I didn't know what does it do until I tried it.
Topic Window handling By EdwinOdesseiron Date 2013-08-15 17:23
Resizable window would probably provide a lot of trouble when making game, as you would have to automate hell a lot of stuff to look correct on different sizes. Especially if you'd want it to look nice. I myself have 2 resolutions in my game, 1024x768 and 1366x768, and I sometimes find it challenging to make things look good in both resolutions (especially things like menus, where I generally do them for non-wide screen, so it fits nicely, but on widescreen they look a bit too spaced out). Now imagine trying to make everything look nice, or at least not overlap with resolutions ranging from 640x480 to 1920x1200.

Although I would like an option like sf::Style::None in the link you posted (or like java's JFrame.setUndecorated(true);), could be useful for start splash screens, like in Skyrim perhaps.
Topic Flight By EdwinOdesseiron Date 2013-08-13 09:17
I checked both codes, and seems to be related to loading graphics, first .png and then .gif. Try adding additional backslash in these lines:
@background = Image.new(@window, "/Graphics/Backgrounds/Highscore.gif", false)
                                                                            ^ About here

If error changed to another line, seems that linux requires these when loading graphics.
Topic Flight By EdwinOdesseiron Date 2013-08-12 20:39
Thanks a lot for the comment!

I do realize most of the things within the code could be done differently, but as I stated, this was my very first thing I ever programmed. I partially lost myself in my own code, and wasn't sure how to achieve some things (like Player classes), so I tried a workaround. I had a limited time to finish that too, so I couldn't really experiment with it, at least not too much. I might soon re-write the code, but at the moment I'm fairly busy with other works.
Topic Flight By EdwinOdesseiron Date 2013-08-11 10:48
Flight was a small project I did last year, for my Software Engineering project. We had to write a program - anything, in any language - that had at least 5 classes. I found this to be a perfect opportunity to learn Ruby and Gosu, and this simple project was born. Since I was still learning, this project took me about 4 weeks of work. It's simple shooter, that you probably can play infinitely. Today I would probably write it better, faster and more advanced, but well ;)

Download link: Click here

I included both .exe file (used Ocra to compile it) and source code. I'm not sure if it will work on linux and/or OSX, because it uses .gif files, but if that's an issue I will convert graphics to .pngs and reupload the game.
Attachment: 01_title.png - Title screen (137k)
Attachment: 02_game.png - Game (91k)
Topic undefined method '+' for nil:NilClass <NoMethodError> By EdwinOdesseiron Date 2013-08-09 13:21
def draw
                if(@menu.state? == true)
                        @menu.draw
                end
        end   


I'd guess the problem lies here. You should probably add some kind of draw for meteor. Though I never used Chingu, I think it doesn't differ that much from gosu?
Topic Internal scripting system for AI and MapScripts By EdwinOdesseiron Date 2013-07-30 21:27
Hi all

I guess this is more of a ruby question than just gosu, but you guys are helpful, so I hope you won't mind much :p
I wanted to create a small, internal map background script system and AI scripts. Pretty much a really basic scripting language within ruby. The map background script would deal with things like if CONDITION then RESULT, ex:
CONDITION GameTrigget ExaminedMine
RESULT SwapNPC Chara01 Chara02

And I figured that I could use String's .include?(keyword), but I wonder if there is any other way I could manage doing that, perhaps easier or more efficient?

Thanks in advance

EdwinOdesseiron / Piotr
Topic Game Application Icon By EdwinOdesseiron Date 2013-07-19 22:48
There's a program called "resource hacker". It lets you open any .exe file and change the icon (open exe, Icon => 1 => 1024). It probably will work with .rb files, but I'm not too sure about it.
P.S. It takes icons in .ico file, you can easily convert them with IrfanView
Topic Is there a way to create outlined text? By EdwinOdesseiron Date 2013-07-17 00:40
Who are you and why did you read my mind? I just got there to ask the same question :p
And if you don't mind me pinning up to your thread, I've got one more text-related question: is there any way, beside Window::scale, to change font size?
Topic Die Erlösung - Redemption. A horror Adventure/RPG game By EdwinOdesseiron Date 2013-07-09 23:06
Small update to the first post. Aside from posting 3 new screenshots, I added these information to What is done? section:
- Base of Container, Enemy, NPC, Door and Waypoint class
- I changed the controls a little bit. Left mouse click selects/orders the characters, double left click on any character selects all four, double click when nothing is selected de-selects all. This leaves right mouse click for a small action sub-menu (think: Planescape: Torment).
- Game_Player class now assigns a Game_Charater, meaning all characters are now actually more than just names - they have their own skills, characteristics, graphics, inventories and so on.
- Skills: Each player has a set of skills that are set at the beginning of the game. These skills are: Pistol, Machine Gun, Rifle, Pick Lock, First Aid, Knowledge, Mechanics. They also have four characteristics: Strength, Dexterity, Energy, Intellect.
- Inventory system: Each character starts with 4 slots in their inventory (+weapon slot and bag slot). This can be extended to 20 slots with a bag. One bag is going to be found quickly and easily, two more will be hidden. I haven't yet decided if I'll include 4th bag (so all characters will have 20 slots), but if I will, it definately will be well hidden. Weight limit (40-49kg, depending on strength) still applies
- Inventory and Character screen.
- Active pause. Lets us pause the game in any moment and think of strategies, give orders etc. when everything is still.


And I also edited the What needs to be done? to remove what I already finished.

And two more things:
- As now I'll most likely be working on the battles itself, I think I'll use something similar to Call of Cthulhu RPG system when it goes to maths part. I'll probably also include some environmental help, though not that advances. Most likely it'll just be the fact, that if our character is standing behind something tall enough (like a flipped-over table), enemy that's shooting at him will have a greater chance to miss.
- When I'll finish making the engine (and map editor, to make my life easier), I'll create a small tech-demo that I'll post on github. It will most likely include 2-3 simple levels, designed just to test and present the features of engine created. One map will probably have the basic navigation, containers, dialogs etc. while second will be testing battle system. Third map will probably be the stress-test map. This will give me a hint how far can i push the game itself without FPS dropping below 40-50 on most computers.
Topic Mouse input? By EdwinOdesseiron Date 2013-07-08 18:56
Just checked, and it actually is. I completely forgot about that method!
Topic Mouse input? By EdwinOdesseiron Date 2013-07-08 16:55
As for the second one, I know that (well, didn't know that I can skip return), but sometimes I prefer to have things a bit clearer. Old habits die hard :p
Topic Mouse input? By EdwinOdesseiron Date 2013-07-08 09:31
Unfortunatelly there is no simple method of using a mouse. Though I made a small Mouse class for my game to make it somewhat simpler. Main part of it is these two methods:
def over?(x,y,w,h)
    if @x >= x and @x <= x+w and @y >= y and @y <= y+h then
      return true
    else
      return false
    end
  end
 
  def over_circle?(x,y,r)
    dist = Math.sqrt((x - @x) ** 2 + (y - @y) ** 2)
    if dist <= r then
      return true
    else
      return false
    end
  end

As I keep mouse in global variable $mouse, whenever I must check if mouse is over a particular part of menu, I just use code:
do_something if $mouse.over?(x, y, width, height)
Works the way it should most of the times.
Topic A few questions on Gosu... By EdwinOdesseiron Date 2013-07-02 22:40
Well, I never looked up on Löve, so I'm not sure whether it is as/more powerful as/than it, but I can try answering most of these questions.

Can Gosu handle SpriteSheets, either via a plugin/library or natively?
Yup, Gosu can natively handle spritesheets. Using
Gosu::Image.load_tiles(window, path, width, height, tileable?)
(where width and height is the size of single sprite (if you're not sure what is the size of single sprites, but know that spritesheet will be ex. 8x8 sprites, use negative values to divide)) will create an array (1d) of Images from given file. You can then access them in other methods, such as draw

Can Gosu render Tiled maps?
If you mean maps created with program called Tiled ( http://www.mapeditor.org/ ) then I'm not sure. If you mean normal tiled map, with tiles stored in 2d array, then yes, Gosu can render those easily, with simple for loops.

Is Gosu capable of creating a commercial game? Purely curiosity!!
Of course, Gosu is capable of creating a commercial game.

Is Gosu still active?
Yup. Gosu is still active, and it is actively being updated (as far as I'm aware). Surely any problem you have with it will be dealt pretty fast, depending on the problem.

I asked this a while ago, but maybe there's one now: Is there a tutorial on Gosu? If not, can I have a game to learn from?
There is definately one tutorial, you can find it here: https://github.com/jlnr/gosu/wiki/Ruby-Tutorial . I guess that's the tutorial most of us (if not all) started with. More you will probably have to learn by yourself, but there are few basic files, well commented too, that you can find in your Gosu gem location, in "examples" folder. Where is it depends on where you installed ruby, ex. on my desktop the path is:
C:\Ruby192\lib\ruby\gems\1.9.1\gems\gosu-0.7.47.1-x86-mingw32\examples

Are there any commercial games made using Gosu?
I don't know that, but I'm actually wondering that myself. I think I read about a Ruby/Gosu game being sold on Steam somewhere, but I'm not sure where, and if I really did, so... yeah.
Topic Die Erlösung - Redemption. A horror Adventure/RPG game By EdwinOdesseiron Date 2013-06-28 16:18
Hi all. I would like to show a project I've been working on for about a month now (over 4 months including story details). The project is still in engine development state, but I work on it daily and the work is going on fairly swift. So, let's get to the details...

And sorry, you're gonna have a bit of reading :p

Story background
In 1933, a servant of Asaroth, Adolf Hitler has come to realize dangers Jewish nation, and it's esoteric knowledge may bring. It's their knowledge and faith that kept Death Angels and forces of Hell to break through. He portrayed Jews as "subrace" to the Third Reich, and waged a war to exterminate them. With the help of SS and Heinrich Himmler, Germany was to exterminate unwanted nation within few years. But first months of the war shown that Archonts are not going to give up. Afraid of the consequences, Hitler and Himmler ordered a ritual to purify their souls and save them from Purgatory. They didn't need to wait for the results long. In December 1939  Todesritter, a special group of SS, found records about the ritual, and began the preparations. The 'Die Erlösung' ritual was to be carried out in March 1940.
But they needed people. Many people, that were to have Hitler's and Himmler's sins transfered onto them. Prisoners of War on Altmark tanker were perfect. The transfer was to be carried out on February 28th, and the ritual would happen on March 11th.
By the end of January, 1940, British fleet came to realize that Altmark is holding English POWs. In two weeks they localized the boat, and carried out the boarding, saving all their prisoners of war.
Echelon, main Todesritter cargo ship - place where the ritual was being prepared - suddenly was endangered. Hitler ordered the preparation of Wasserübung operation that would recapture the Echelon in case worst has happened. On February 26th Himmler ordered 'Die Erlösung' ritual to be carried out at any cost, using their own "human" resources. Out of 120 people, 40 were to be sacrificed, which meant a revolt. Dietrich von Marienburg, top Todesritter officer gathered 20 of his most trusted men. Orders were simple: imprison about 40 people. In case of any signs of revolt, kill without mercy. In the night, 27th to 28th of February, this operation was carried out. Within an hour they had 45 people imprisoned, and the rest was told that "they were traitors". Everything went great, and the final date, which was to bring salvation to both Hitler and Himmler, was March 20th, 1940.
On March 18th, Echelon went silent...


Game Plot
After a revolt carried out by one of the Todesritter commanders-in-chief, Albert Zoltman, interrupted the preparations. The Illusion was broken, and Echelon was slowly interconnecting with the City of Machines, merging Metropolis and Elisium. Most of the crew died within hours, either killed by soldiers of von Marienburg, or creatures their own fear has summoned. The ship was abandoned quick, and it became a prison for only man alive - Dietrich von Marienburg. For days he fought for life, and even though his protecting glyph saved him from the creatures from outside of Illusion, his sanity was deteriorating. His psychosis was deepening. On April 8th he began his preparation for upcoming meeting with Kriegsmarine. He destroyed most of the traces and documents on Echelon.
The evening was full of surprises though. He came to realize, that he is not the only human alive on the ship...


Player Characters
In the game, the player will play with 4 characters at a time. These characters are: Reiner von Dortmund, Heinrich Blitz, Georg Beziehung and Albert Goldmann. All four are always available for player, and each of them has their own set of specialties that may help them survive... for now.

Game Characteristics
I designed the story and the game, to make the playing enjoyable and full of surprises. The whole game happens on Echelon, which is a 4-level Cargo ship. Most of the rooms are available in some way, but not all are opened. Some may require the player to find another way, perhaps through a ventilation shaft. Or even to blow up the door with a bit of dynamite. Also, before the game starts, we set the skills our characters have, so we decide what are the strengths and weaknesses of each of the characters.
Because of the damage Echelon took over past days, the ships damage may increase over time, ex. the pressure may blow the pipe open, and ship will start sinking a bit more.
The characters suffer from amnesia caused by the events that happened on Echelon. During the game, amnesia slowly subsides, revealing more details of what happened. And more of the dark corners of human nature...


What is done, and what is planned to be done?
As I said in the beginning, the engine itself is still on its WIP stage. As the work progresses, the list below will change. Also, quick sidenote - most of the screenshots that will appear here will be in Polish. This is because it's my first language, and I'm developing the game in it, but as soon as polish version is done, I will translate it to English. When creating engine, I try to put all that may need translation in three variables: $DICTIONARY, $DIALOG and $DESCRIPTION, so translating it will be a matter of few days.
What is done?
- Displaying
- Player characters: all 4 characters are on the map, they can be selected and moved.
- Pathfinding: unfortunately, after trying to write A* algorithm and failing, I created a bit worse pathfinding algorithm. But it still works, and gets the characters to desired place about 90% of times.
- Fog of War: With 3 states. Hidden, seen-but-covered and visible. It's based on game grid, so it doesn't look that good now (32x32 squares).
- Dialogs: Dialogs in game are displayed in a large window appearing on the bottom half of screen. Think Baldur's Gate-like.
- HUD: Divided into 3 parts: Left, which displays menu sections (Game, Map, Notes, Inventory, Character, Options), Right which displays the characters, and bottom which is kind of a dialog window, but smaller in size. Again, thing Baldur's Gate-like.
- Basic entity: At the moment entity just is, and clicking on it starts the dialog.
- Time engine. 15s in real life is 1 minute in game. This will set the game time to about 1h 45min before the events at the end of story start happening.
- Location Map: Displays current location scaled down. FOW still works on it, so it won't show us what we didn't see yet.
- Base of Container, Enemy, NPC, Door and Waypoint class
- I changed the controls a little bit. Left mouse click selects/orders the characters, double left click on any character selects all four, double click when nothing is selected de-selects all. This leaves right mouse click for a small action sub-menu (think: Planescape: Torment).
- Game_Player class now assigns a Game_Character, meaning all characters are now actually more than just names - they have their own skills, characteristics, graphics, inventories and so on.
- Skills: Each player has a set of skills that are set at the beginning of the game. These skills are: Pistol, Machine Gun, Rifle, Pick Lock, First Aid, Knowledge, Mechanics. They also have four characteristics: Strength, Dexterity, Energy, Intellect.
- Inventory system: Each character starts with 4 slots in their inventory (+weapon slot and bag slot). This can be extended to 20 slots with a bag. One bag is going to be found quickly and easily, two more will be hidden. I haven't yet decided if I'll include 4th bag (so all characters will have 20 slots), but if I will, it definitely will be well hidden. Weight limit (40-49kg, depending on strength) still applies
- Inventory and Character screen.
- Active pause. Lets us pause the game in any moment and think of strategies, give orders etc. when everything is still.
- Particle Engine: both for continuous animation (like fire, smoke, water leaking from pipe) and single animations (explosion, blood shooting out when shot, smoke from gun after shooting).
- Re-designed HUD, it now fits nicely on one (left) side of screen!
- Animated intro (2 short "video clips", one displaying "Powered by Ruby and Gosu", seconds shows my creator's logo), of course it can be skipped
- When player's resolution is the same, or smaller than game resolution (that is 1024x768 or 1366x768), he or she is prompted that window is scaled down and some graphic may look glitchy, and that it is advised to turn on full-screen mode in Settings.
- Some other things, that aren't really worth mentioning at the moment.

Mental states:
In "Character" screen we will sse a triangle, with its three corners pointing to three states: Fatigue, Fear and Paranoia. The more graph goes towards the state, and more red it is, the more given character is influenced by this state. First two decrease our skills, where Paranoia is most dangerous one. On higher level the character may start running, and when it will reach 100% - the character goes through mental breakdown and shots himself.


And note at the end: Most of the graphics on the screens below are just acting as a placeholders. They will be replaced with better, but still similarly looking graphics later on.
Attachment: Image11.png - Hintbox. Will display small info (like character name and health) when mouse over and Tab pressed. (20k)
Attachment: Image12.png - Fog of War (42k)
Attachment: Image19.png - Simple, example dialog. HUD on the right is visible as well. (92k)
Attachment: Image32.png - Box selecting (20k)
Attachment: Image13.png - Game Title screen. (357k)
Attachment: Image26.png - Character screen. Portrait (both main and all 4 portraits on HUD) is a placeholder. (1375k)
Attachment: Image28.png - Random HUD screenshot, showing how health is going to be displayed. (46k)
Attachment: 22.png - Example of particles (fire and smoke) (22k)
Attachment: NewHUD.png - New HUD design (30k)
Topic Ruby: Operations on strings for dialog By EdwinOdesseiron Date 2013-06-23 11:50
Hi all.

I made a handy dialog system for my project, which stores the dialog within a hash (example dialog looks like that:
'Dialog' => [
          ["Talker"],
          ["Dialog Message"],
          [["Reply 1", "Resulting dialog"]],
          [["Reply 2", "Resulting dialog"]],
          ...
          [["Reply N", "Resulting dialog"]]
        ]

)

And it works well, includes line break etc. I also made a small function, that checks if either message or replies include "[PLAYER_NAME]", it is substituted with the name of a player character that is talking:
@message["[PLAYER_NAME]"] = @player.name if @message.include?("[PLAYER_NAME]")

And I need 2 more functions like that, and I can't think of how to do them. These functions are
- if message/reply includes "[VAR X]", then it is substituted with the value of variable X (so if I'd write "[VAR $game_width]", it would write "1366" in dialog.
and
- if message/reply includes "[NOTES KEY]", then this part is deleted, but it also calls function add_note(KEY).

So I pretty much can't figure out how to get variable values from string. Any help will be greatly appreciated!
Topic Dealing with '_release_all_openal_resources' audio bug By EdwinOdesseiron Date 2013-06-18 15:42
Okay, my bad now. It does actually work, but I forgot to change files in project folder (OpenAL32.dll, libsndfile.dll, gosu.for_1_9.so and so on) to newer after I updated gosu. Now it does work like charm. Sorry for troubles.

Regards
Edwin
Topic Dealing with '_release_all_openal_resources' audio bug By EdwinOdesseiron Date 2013-06-18 13:08
Hi all.

I guess this problem, when shutting down your gosu project that uses audio, is quite common. I have tried to somehow make it go, but didn't work. In my project, I've created a global, Audio class that deals with all audio (duh) in game. Also, my Window class has a "shutdown" method. To keep it short - when I click on "exit" option, it calls window's "shutdown" method, which looks like that:

def shutdown
  $audio.kill
  if $audio.killed? then
    $audio = nil
    if $audio == nil then
      close
    end
  end
end

The "$audio.kill" method looks like that:

def kill
  @bgm.stop
  @bgm = nil
  @bgs = nil
  @se = nil
  @buzz = nil
  @click = nil
  @opt = nil
end

and "killed?" just returns true if all audio variables (Song and Samples) are nil. So basically, before I try to close window, I remove all audio from game. But the error still occurs. How can I fix that?

Regards
Edwin

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill