SFML community forums
General => SFML projects => Topic started by: eigenbom on December 15, 2011, 05:56:44 am
-
Hi guys, long time lurker and user of SFML, first time poster!
Here's a little game (http://bp.io/post/708) I made with SFML2. I'm working on a bigger, terraria-like game, called Moonman, which I'm devlogging over at tigforums (http://forums.tigsource.com/index.php?topic=21997.0). Overall, I've been very impressed with SFML2, nice clean design, and I was able to build the game on Windows and Mac without too much trouble.
(http://bp.io/wp/wp-content/uploads/2011/12/xmas_cover.png)
Keep up the good work Laurent and co. :)
-
oO
Is the world infinite ?
-
No, but its very big, 2^32 blocks wide, 2^16 blocks high. There's not much out there though :P
-
Oh ok. I was trying to reach the sky or reach the earth's core but.. I coudln't :lol: . Simple but funny game :)
-
I saw your thread on tigsource a few weeks ago, it looked awesome. I'm glad it's now playable (sort of). :)
-
Looks nice! Hoewever you should use the function to get if windo lost focus to avoid keypresses when window is not active ^^
I really want to know how do you manage collision with sooooo many block? Grids? Quad trees? I reaaly wanna know :P
-
Thanks for the replies guys!
@posva Yeh I only noticed the focus bug after my cutoff time, but I'll definitely fix it for moonman proper! The blocks are always aligned to a grid (they have integer coords), so collision detection is fairly simple. :D
B
-
The building on the picture suspitiously resembles the Lenin's Mausoleum in Moscow, Russia. :) Maybe that funny guy is Lenin himself. 8)
-
Thanks for the replies guys!
@posva Yeh I only noticed the focus bug after my cutoff time, but I'll definitely fix it for moonman proper! The blocks are always aligned to a grid (they have integer coords), so collision detection is fairly simple. :D
B
But with such a big world do you check all the blocks, or do you have arrays that point to them? If so, how big is the array? xD
-
But with such a big world do you check all the blocks, or do you have arrays that point to them? If so, how big is the array? xD
For efficiency reasons the world is split into chunks, which contain 256x256 blocks. These chunks are generated on demand (and eventually will be stored/loaded on disk as required). The chunks just have an array int[256*256], so block lookup inside a chunk is O(1). So doing a block lookup, I first retrieve the chunk (just stored in a std::list for now, but eventually will be in a hashtable) then get the block.. works fast enuf for simple stuff but has lots of room for improvement. I think I explain the collision routine in my devlog (http://forums.tigsource.com/index.php?topic=21997.0).
-
For efficiency reasons the world is split into chunks, which contain 256x256 blocks. These chunks are generated on demand (and eventually will be stored/loaded on disk as required). The chunks just have an array int[256*256], so block lookup inside a chunk is O(1). So doing a block lookup, I first retrieve the chunk (just stored in a std::list for now, but eventually will be in a hashtable) then get the block.. works fast enuf for simple stuff but has lots of room for improvement. I think I explain the collision routine in my devlog (http://forums.tigsource.com/index.php?topic=21997.0).
By devblog you meant http://bp.io/ ?
Anywat I searched both :P and didn't found what you was talking about.
I trie dto search for hastables but the text was too long and I'm tired lol
I asked you because I'm always looking forward efficiency issued and improvements and Unniversity is slow learning you things, I would rather take lessons by myself but I need the grade...
Well you collision system impressed me because the world is huge (it really looks infinite lol) and I also love the sky and the water (what a beauty, I though a time ago about making water EXACTLY like what you did but I never implemented it)
-
Release a Linux-version so us linuxdevelopers can try the game in our favourite platform :D Since Im +++ for crossplatform and gaming as well, I have windows-systems as well, so ill try this out whenever I'm at it.
Release a gameplay vid or something!
-
@Haikarainen:
Actually I've played it under Wine, so you can try it in your Linux Box! :P
@eigenbom:
What a nice game you have here!
I'm especially interested in your data-driven design. Do you have previous game projects with a more traditional design? How are data-driven and traditonal game design relate to each other as in terms of productivity?
I've downloaded the docs you've posted on that other forum about this topic. I had no time yet to read them thorugh 100%, but I find it very interesting and appealing.
Is this closed or open source?
-
Whoops I stopped receiving update emails about this thread so sorry for the late reply..
@posva i was just referring to a little post on the tigforums about the lower-level collision routine, but it wasn't very detailed so forget about it. :)
@haikarainen I'd love to release a Linux version, but if it works under Wine, then there's no need -- making the Mac release was such a pain in the butt, I don't really want to touch another platform for a while ... :D
@easy Thanks! This is my first foray into both data-driven and component/entity design. I don't think I know enough to really comment, but one thing I've noticed is that it takes much loooonger to actually build the thing, but if you do it general enough then its easier to add new things or add properties to old things, or inspect the properties of things at runtime, etc... Oh and its closed source, sorry! :( (I hope to develop the full moonman game to the point where I can sell it.)
-
Oh yes the components that is the most interesting part! Adding a general AI to a new type of character with one line of code and fine-tuning it through some properties really sounds compelling, especially since you can do it by editing an .ini file, and not touching the code itself.
Today I had to roll through all the functions in all the classes about entities because of a small additional feature. This is annoying somewhat.
So it takes longer to build? I was expecting to be faster, actually, but I can see your point. Making really useful - and general - components might take more time, but probably in the end you'll have a collection of proven pieces of code that you can re-use.
No problem that it's closed source, of course. Everybody tries to make ends meet somehow. :) Then I'll try to follow the development and catch some bits about how this data-driven and component-based design works.
Oh, and it really sux under Wine. It crashes all the time, so you might re-consider making a linux version. (I'm just kidding, it was all right. :D But come on, we Linux guys deserve games like this! We usually pay more in average than any Mac/Windows user anyway, see the results of any Humble Inide Bundle!)
-
I think it takes longer, or just as long, to build because everything is more general, so like in traditional OO hierarchies its still tough to figure out what abstractions you'll need -- in this case components rather than interfaces.. BUT .. once you've built a bunch a components for a specific game, it should be easier to reuse the code in another game.
I guess it's taking me longer than usual because a) I'm a noob, and b) I started from scratch, and c) I spend too much time on forums ;)
Good point about the Linux build, and yeh I remember hearing that about the generosity of Linux gamers. I do intend to release moonman on all 3 major platforms though, and SFML helps heeeeaps in this regard, but I'll let you know when the alpha is out. Hopefully in April sometime. :D
B
-
Okay! Keep up the good work! :)