Moonman Devlog Archive

Archived on 2014-07-29


Page 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64


Title: moonman
Post by: eigenbom on 30-09-2011, 03:22:56
MOONMAN

This is the development log for Moonman http://moonman.io/. Moonman will feature an immersive, procedurally-generated world with strange creatures, abundant minerals, and exotic weapons. It is heavily inspired by games such as Knytt Stories, Terraria, Nethack, Dwarf Fortress, and Minecraft.

Follow me at @eigenbom https://twitter.com/eigenbom for regular updates. Sign up to the mailing list at http://moonman.io/ http://moonman.io/ to get notified of the release. I also maintain a facebook https://www.facebook.com/pages/Moonman/333164920040372 page if that's your thing.



Title: Re: moonman
Post by: eigenbom on 30-09-2011, 03:31:30
here's a screenshot. so far you can walk around, the collision and physics works well enough (only a few instances of walk-thru-walls ::) ), and you can place and delete blocks.



the cave generation is just a placeholder at the moment, but works well enough to test the other parts of the engine. you can also zoom out, in game, at the cost of your CPU burning up...



zoomed more , and more


Title: Re: moonman
Post by: eigenbom on 30-09-2011, 03:33:23
another oldish screenshot



Title: Re: moonman
Post by: eigenbom on 30-09-2011, 03:36:20
videos!

testing the collision system http://www.youtube.com/watch?v=07nUfOkf1T0 http://www.youtube.com/watch?v=07nUfOkf1T0
experimenting with water http://www.youtube.com/watch?v=xIeAxAnV9YM http://www.youtube.com/watch?v=xIeAxAnV9YM


Title: Re: moonman
Post by: Ashkin on 30-09-2011, 05:44:30
Well wow, this looks pretty cool! What are you developing it in?


Title: Re: moonman
Post by: eigenbom on 30-09-2011, 05:50:47
Quote from: Ashkin on 30-09-2011, 05:44:30
Well wow, this looks pretty cool! What are you developing it in?

Thanks! I'm developing it in c++, and using sfml for windowing/drawing/events/etc.


Title: Re: moonman
Post by: happymonster on 30-09-2011, 13:42:04
I also like the art style.. :)


Title: Re: moonman
Post by: eigenbom on 03-10-2011, 23:35:44
an animation attempt..




Title: Re: moonman
Post by: eigenbom on 04-10-2011, 21:12:38
Added a simple logging system, using cpplog https://github.com/andrew-d/cpplog(which is nice and simple.)


Title: Re: moonman
Post by: Belimoth on 04-10-2011, 21:41:22
I like this visual style a lot ;D

Also I am jealous of your water.


Title: Re: moonman
Post by: eigenbom on 04-10-2011, 21:47:18
Quote from: Belimoth on 04-10-2011, 21:41:22
I like this visual style a lot ;D

Also I am jealous of your water.

Thanks, comments like this keep me motivated!

The water model is tricky to tweak, and is more like blue sand at the moment. Needs quite a bit more development before I'll be happy with it. :)


Title: Re: moonman
Post by: eigenbom on 06-10-2011, 03:59:30
Ideally I'd like it to be very easy for someone to add a new animal, enemy, item, or effect to the game. To that end I've worked a bit today on the entity system, trying to design a nice entity-based system with lua scripting, networking, and simple storage. Once finished, a user should be able to add e.g., a chicken to the game by writing a little lua script:

Code:
local cluck_pid, chicken_eid
function onLoad()
  cluck_pid = register_property("chicken_clucker", clucker())
  chicken_eid = register_entity("chicken", chicken())
end

function chicken()
  local ch = create_entity("actor")
  ch.sprite = sprite_sheet("chicken.png", ...)
  ch.speed = .1
  ch.add_attribute_bool("clucking", false)
  ch.add_property(cluck_pid)
  return ch
end

function clucker()
  local p = create_property()
  p.on_receive_message = function(e,msg)
    if (msg.type == APPLY_DAMAGE)
      e.clucking = true
    end
  end
  return p
end

The design's a mashup of the ideas from some of the following articles, and I'll write some more about it as it is fleshed out some more.

A Data-Driven Game Object System - Scott Bilas http://scottbilas.com/files/2002/gdc_san_jose/game_objects_slides.pdf

Entity Systems are the future of MMOG development - Adam Martin http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/

The Nebula3 Application Layer http://flohofwoe.blogspot.com/2007/11/nebula3s-application-layer-provides.html

Evolve Your Hierachy - Mick West http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/



Title: Re: moonman
Post by: kamac on 06-10-2011, 10:04:52
Nice  :waaagh:


Title: Re: moonman
Post by: eigenbom on 08-10-2011, 04:25:38
some moonman mockups, with weapons and in various guises



Title: Re: moonman
Post by: eigenbom on 08-10-2011, 05:08:42
@kamac cheers!

I'm not sure if anyone's interested in technical details, but I'll write a few more words on the design just in case. I mocked up some of this design in code the last couple of days.

Every character, item, weapon, effect, gui element, etc., in moonman is an Entity. An Entity is composed of Attributes and Properties. Attributes are key-value pairs which specify the shared data of an entity, and the sum of properties in an entity specify its capabilities. For instance, an npc in the game might be created as follows:

Code:
// script
npc = create_entity {x=0,y=0,vx=0,vy=0,onground=false,sprite="someguy.png"}
npc:add_property(physics)
npc:add_property(walker)
npc:add_property(renderable)
npc:add_property(ai_controller)

Each property has an update and onMessage function, and has access to the shared data in an entity. e.g.,

Code:
// c++
class PhysicsProperty {
public:
  virtual void update(Entity* e, double dt){
    e->attrib(x) += e->attrib(vx)*dt
    // ...
  }
}

The attributes are accessible by all the properties because there is commonality between them (e.g., the Renderable property needs the x and y coordinates to draw the npc in the right location.) This simplifies things, at the cost of being easier to shoot yourself in the foot (so as rule of thumb: each attribute should be modified by only one property).

An attribute in my engine is implemented as a boost::variant:
Code:
typedef boost::variant<bool,int32,float,std::string> Attribute;

Each attribute and property is assigned a unique integer id. This is for efficiency reasons (an integer lookup is quicker than a string lookup and an integer is smaller than a string). However, because users can add new attributes and properties, the assigning of ids is done dynamically. E.g., a user can add a new entity attribute of type float, with a default value of 1.5., by writing
Code:
// lua
id1 = register_attribute_float("foo",1.5)
The registry returns an attribute id that the script can store (for this instance) to refer to the attribute, e.g.,
Code:
// lua
some_entity.attrib(id1) = .5
... although I'm investigating Lua meta-tables to see if I can allow the much simpler...
Code:
some_entity.foo = .5

In regard to the multiplayer aspect the server and client may be running different scripts/mods (or have them loaded in different order), which means that the attribute id's may be different. Hence, the client needs to store an mapping between the servers ids and the clients ids. This can be done fairly efficiently just by recording which blocks of ids belong to which mods. Saving a game world to disk is also simplified using a global id system.

I've never built a game this way, I typically just hard hard-coded all the classes into some inheritance hierarchy, so I find it very interesting to build types dynamically. It seemed to work for Dungeon Siege, Neverwinter Nights, etc, but I'm just a lone coder .. so we'll see whether I'm consumed by the extra work required or not!


Title: Re: moonman
Post by: eigenbom on 09-10-2011, 07:48:41
another animation test: ____________


Title: Re: moonman
Post by: eigenbom on 09-10-2011, 23:17:17


Title: Re: moonman
Post by: cactus on 09-10-2011, 23:33:22
Love the style in this.


Title: Re: moonman
Post by: Ashkin on 09-10-2011, 23:36:56
I just want you to know that the player's unending and almost maniacal grin, even (especially?) when he's holding a weapon of mass destruction, unnerves me to no end.


Title: Re: moonman
Post by: eigenbom on 09-10-2011, 23:44:34
@cactus cheers! and i loved psychosomnium btw

@ashkin haha, yeh i noticed/felt that too. i figure it will offer a nice mood to the game, initially you just think he is happy, but then the grin never falters even when he (you) are killing things, so you might end up really fearing this small clump of pixels..


Title: Re: moonman
Post by: xoorath on 10-10-2011, 01:51:37
Quote from: eigenbom on 09-10-2011, 23:17:17


Work that strut! Daaaayyyyyyuuuummm gurl!


Title: Re: moonman
Post by: BadgerManufactureInc on 10-10-2011, 11:00:27
Quote from: eigenbom on 09-10-2011, 23:17:17


This looks very good. I'm excited about playing a demo.

Are you using a tilemap engine?  If so, I'd be interested to hear how you are doing the collisions.


Title: Re: moonman
Post by: eigenbom on 10-10-2011, 21:16:03
@xoorath aw yeh!

@barnaby Cheers! The world is split into a grid, each cell has a 32-bit coordinate, so at a walking rate of 8 blocks a second, it will take about 17 years to get from one side of the world to the other. :o As for the collisions, the method I'm using has not really been tested on large numbers of entities, but seems to work ok.

Each object in the world gets an integer width w and height h (e.g., 1x3 for moonman), and a collision width and height (.9x2.8 for moonman). the collision width and height are less than the actual width and height so moonman can fall in unit width holes, fit nicely into a cave of height 3, etc.


Sensors are placed on an entity at the junctions of their geometry, so moonman has 8 sensors, 4 on each side. Which sensors are used depends on the direction the entity is going. So when falling straight down only the two bottom sensors are user.

In an update step, the entity's position is updated, and each appropriate sensor is traced through the world using this algorithm http://playtechs.blogspot.com/2007/03/raytracing-on-grid.html. The tracing splits the sensor up into segments, each of which are tested against the cells in turn for collision. If the cells contain a full block or an empty block then the check is trivial. If the cell contains a slope then a little more code magic is required.

That's the general idea, but its a little more complicated. For instance, if the sensors are just points, then some funny stuff can happen, like getting caught on the side of a cliff as you fall. So instead, I include the two adjacent edges to the sensor when checking the collision.

A few random notes:

Some more refs:
http://info.sonicretro.org/Sonic_Physics_Guide http://info.sonicretro.org/Sonic_Physics_Guide
http://www.gamedev.net/topic/509143-how-to-go-about-platformer-physics/ http://www.gamedev.net/topic/509143-how-to-go-about-platformer-physics/



Title: Re: moonman
Post by: Pemanent on 10-10-2011, 21:33:41
Yeah agreed on the characters smile. Reminds me of No Country for Old Men
(http://1.bp.blogspot.com/_H9QxSvUOvwI/TN2P_SQYF8I/AAAAAAAAE4s/hirxSTApMLE/s1600/no%2Bcountry%2Bfor%2Bold%2Bjavier-bardem.jpg)


Title: Re: moonman
Post by: eigenbom on 10-10-2011, 21:46:16
and just to burn that association into your minds ... :addicted:





Title: Re: moonman
Post by: Belimoth on 10-10-2011, 23:50:29
Quote from: eigenbom on 10-10-2011, 21:46:16
and just to burn that association into your minds ... :addicted:



Needs a themesong http://soundcloud.com/infectedmushroom/you-are-so-fucked-demo.


Title: Re: moonman
Post by: Pemanent on 11-10-2011, 01:09:49
 :epileptic: I'm not going to sleep tonight.


anyways. back to the game. I'm really intrigued so far!


Title: Re: moonman
Post by: eigenbom on 13-10-2011, 00:59:14
Exploring syntax for custom object creation in moonman. Somewhat following the design of the mod system in dungeon siege (url http://garage.gaspowered.com/?q=su_201). I'm interested if this script is readable for those who aren't familiar with Lua or scripting in general.

Also, a Q for any mods reading, are we able to get syntax highlighting enabled for the code tags for Lua?

Pastebin higlighted version http://pastebin.com/FeqcH41R
Code: (Lua)
-- A prototype of custom sword creation in moonman.
-- BP 14.10.2011

local custom_sword_sprite_id
local custom_sword_id

-- this function creates a template for the new sword
local function custom_sword()
return {
name = "custom sword",
inherits = core_entities.sword,
-- set the default attributes
attributes = {
damage = 10,
speed = 2,
sprite = custom_sword_sprite_id
},
-- this sword kills outright for enemies
-- not wearing armour
onHit = function(self,enemy)
if (not enemy.armor) then
send_message(core_messages.kill, {target=enemy})
return true -- handled
else
return false -- run normal sword onHit
end
end,
-- 5% of swords spawned are practically useless against armoured enemies
onSpawn = function(self)
if (random()<.05) then
self.damage = 1
end
end
}
end

-- the recipe indicates what amount of
-- each item goes where in the 5x5 crafting matrix
-- in this case: its just a vertical line in the center
local recipe = {
craft.coord(2,0) = {core_entities.steel,2},
craft.coord(2,1) = {core_entities.steel,2},
craft.coord(2,2) = {core_entities.steel,2},
craft.coord(2,3) = {core_entities.ebony,2},
craft.coord(2,4) = {core_entities.ebony,2}
}

-- finally, the onLoad function is called at setup
-- and registers the new sprite, sword type, and recipe
-- for building the sword
function onLoad()
custom_sword_sprite_id = register_sprite("custom_sword_sprite_id", "sprites/mysword.sprite")
custom_sword_id = register_entity("custom_sword", custom_sword())
register_recipe(custom_sword_id, recipe)
end


Title: Re: moonman
Post by: xoorath on 13-10-2011, 03:35:05
Quote from: eigenbom on 13-10-2011, 00:59:14
Also, a Q for any mods reading, are we able to get syntax highlighting enabled for the code tags for Lua?

Is there syntax highlighting for any language?


Title: Re: moonman
Post by: eigenbom on 15-10-2011, 05:43:09
@xoorath not sure, but there should be!

Update: Alrighty, I'm now getting back to the game after a few hectic days graduating http://forums.tigsource.com/index.php?topic=22242.0 and partying. Today I just played with the mockup a little, tweaking the colours a bit and adding some subtle texturing and lighting. I think the mockup is starting to approach something I would be happy with visually.



Title: Re: moonman
Post by: eigenbom on 16-10-2011, 07:12:38
just got a few mins today, so did some whacking tests ... O_O



Title: Re: moonman
Post by: negativeview on 16-10-2011, 10:59:12
The first one seems a little slow. Really love the rest, especially the bounce in the hammer.


Title: Re: moonman
Post by: eigenbom on 17-10-2011, 06:23:45
@negativeview cheers for the feedback

here's some more tests ... i'm getting ready for a 3 day moonman coding sprint tomorrow!!



Title: Re: moonman
Post by: eigenbom on 17-10-2011, 07:34:10



Title: Re: moonman
Post by: Belimoth on 17-10-2011, 13:06:47
Quote from: eigenbom on 17-10-2011, 07:34:10


I feel like the top of the head should lower when the chin comes up, unless this is some crazy moonman anatomy thing. It makes it seem like his neck connects to the top of his head.


Title: Re: moonman
Post by: xoorath on 17-10-2011, 17:01:44
I really like the spin animation. Your art is graceful, and it makes me smile. That little green guy has personality.  :):handthumbsupR:


Title: Re: moonman
Post by: eigenbom on 17-10-2011, 19:14:23
@belimoth thx for the feedback. i had another go, taking your comments into account. looks a little better, but still not quite right..



@xoorath thx a lot! i was unsure about doing the art and sprites myself (i'm much more a programmer than artist), but I'm glad someone likes it. :)


Title: Re: moonman
Post by: Pemanent on 18-10-2011, 01:33:58
Yeah I love this guy so far. I hope his story and background fit him.
haha his mouth becomes one with the background. I think maybe a very very dark grey background would be better.


Title: Re: moonman
Post by: eigenbom on 18-10-2011, 06:21:54
Update: Major refactoring today. I merged my entity system with the main codebase, and I'll continue this tomorrow - adapting the physics and collision system to work with the new entity-based design.

But to keep this devlog interesting, here's a few more animation tests ...

@pemanent nice observation, heres a more subtle laugh with a lighter background..


decreased strut factor:




Title: Re: moonman
Post by: Momeka_ on 18-10-2011, 09:46:58
Quote from: eigenbom on 18-10-2011, 06:21:54


I love it.


Page 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64