Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Moonman's Xmas  (Read 10243 times)

0 Members and 1 Guest are viewing this topic.

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Moonman's Xmas
« 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 I made with SFML2. I'm working on a bigger, terraria-like game, called Moonman, which I'm devlogging over at tigforums. 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.



Keep up the good work Laurent and co. :)

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Moonman's Xmas
« Reply #1 on: December 15, 2011, 09:25:41 am »
oO

Is the world infinite ?
Want to play movies in your SFML application? Check out sfeMovie!

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Moonman's Xmas
« Reply #2 on: December 15, 2011, 09:42:52 am »
No, but its very big, 2^32 blocks wide, 2^16 blocks high. There's not much out there though :P

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Moonman's Xmas
« Reply #3 on: December 15, 2011, 12:31:22 pm »
Oh ok. I was trying to reach the sky or reach the earth's core but.. I coudln't :lol: . Simple but funny game :)
Want to play movies in your SFML application? Check out sfeMovie!

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Moonman's Xmas
« Reply #4 on: December 15, 2011, 06:02:14 pm »
I saw your thread on tigsource a few weeks ago, it looked awesome. I'm glad it's now playable (sort of). :)

posva

  • Full Member
  • ***
  • Posts: 118
  • Feed me pls
    • View Profile
    • Posva Dev Blog
Moonman's Xmas
« Reply #5 on: December 15, 2011, 08:52:09 pm »
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

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Moonman's Xmas
« Reply #6 on: December 15, 2011, 10:28:12 pm »
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

Relic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Moonman's Xmas
« Reply #7 on: December 16, 2011, 02:44:43 pm »
The building on the picture suspitiously resembles the Lenin's Mausoleum in Moscow, Russia. :) Maybe that funny guy is Lenin himself. 8)

posva

  • Full Member
  • ***
  • Posts: 118
  • Feed me pls
    • View Profile
    • Posva Dev Blog
Moonman's Xmas
« Reply #8 on: December 16, 2011, 02:55:47 pm »
Quote from: "eigenbom"
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

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Moonman's Xmas
« Reply #9 on: December 16, 2011, 09:40:19 pm »
Quote
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.

posva

  • Full Member
  • ***
  • Posts: 118
  • Feed me pls
    • View Profile
    • Posva Dev Blog
Moonman's Xmas
« Reply #10 on: December 16, 2011, 10:04:05 pm »
Quote from: "eigenbom"

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.

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)

Haikarainen

  • Guest
Moonman's Xmas
« Reply #11 on: December 17, 2011, 12:31:50 am »
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!

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Moonman's Xmas
« Reply #12 on: December 19, 2011, 09:33:06 pm »
@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?

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Moonman's Xmas
« Reply #13 on: December 20, 2011, 06:55:54 am »
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.)

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Moonman's Xmas
« Reply #14 on: December 20, 2011, 11:09:49 am »
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!)