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

Login with username, password and session length

 
Advanced search

1291931 Posts in 57327 Topics- by 48360 Members - Latest Member: laingsoft

April 23, 2017, 03:43:02 pm

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsFeedbackDevLogsmoonman
Pages: 1 [2] 3 4 ... 185
Print
Author Topic: moonman  (Read 944249 times)
xoorath
Level 2
**


I make things.


View Profile WWW Email
« Reply #20 on: October 10, 2011, 07:51:37 pm »



Work that strut! Daaaayyyyyyuuuummm gurl!
Logged

BadgerManufactureInc
Guest
« Reply #21 on: October 11, 2011, 05:00:27 am »



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.
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #22 on: October 11, 2011, 03:16:03 pm »

@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. Shocked 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. 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:
  • When landing on a slope the bottom-side sensors are ignored, and a bottom-center sensor is used instead.
  • Entities have an onGround flag, and the physics and collisions are done differently based on this.
  • The raycasting can be simplified if you cap the velocity of entities to one tile per frame - but i haven't done this.

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

« Last Edit: October 11, 2011, 03:22:37 pm by eigenbom » Logged

MOONMAN devlog WWW FORUM
Pemanent
Level 3
***



View Profile Email
« Reply #23 on: October 11, 2011, 03:33:41 pm »

Yeah agreed on the characters smile. Reminds me of No Country for Old Men
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #24 on: October 11, 2011, 03:46:16 pm »

and just to burn that association into your minds ... Addicted



« Last Edit: October 11, 2011, 04:11:25 pm by eigenbom » Logged

MOONMAN devlog WWW FORUM
Belimoth
Level 10
*****


high-heeled cyberbully


View Profile
« Reply #25 on: October 11, 2011, 05:50:29 pm »

and just to burn that association into your minds ... Addicted



Needs a themesong.
Logged

Pemanent
Level 3
***



View Profile Email
« Reply #26 on: October 11, 2011, 07:09:49 pm »

 Epileptic I'm not going to sleep tonight.


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

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #27 on: October 13, 2011, 06:59:14 pm »

Exploring syntax for custom object creation in moonman. Somewhat following the design of the mod system in dungeon siege (url). 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
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
Logged

MOONMAN devlog WWW FORUM
xoorath
Level 2
**


I make things.


View Profile WWW Email
« Reply #28 on: October 13, 2011, 09:35:05 pm »

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?
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #29 on: October 15, 2011, 11:43:09 pm »

@xoorath not sure, but there should be!

Update: Alrighty, I'm now getting back to the game after a few hectic days graduating 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.

Logged

MOONMAN devlog WWW FORUM
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #30 on: October 17, 2011, 01:12:38 am »

just got a few mins today, so did some whacking tests ... O_O

Logged

MOONMAN devlog WWW FORUM
negativeview
Level 0
***


View Profile
« Reply #31 on: October 17, 2011, 04:59:12 am »

The first one seems a little slow. Really love the rest, especially the bounce in the hammer.
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #32 on: October 18, 2011, 12:23:45 am »

@negativeview cheers for the feedback

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

Logged

MOONMAN devlog WWW FORUM
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #33 on: October 18, 2011, 01:34:10 am »


Logged

MOONMAN devlog WWW FORUM
Belimoth
Level 10
*****


high-heeled cyberbully


View Profile
« Reply #34 on: October 18, 2011, 07:06:47 am »



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.
Logged

xoorath
Level 2
**


I make things.


View Profile WWW Email
« Reply #35 on: October 18, 2011, 11:01:44 am »

I really like the spin animation. Your art is graceful, and it makes me smile. That little green guy has personality.  SmileyHand Thumbs Up Right
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #36 on: October 18, 2011, 01:14:23 pm »

@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. Smiley
Logged

MOONMAN devlog WWW FORUM
Pemanent
Level 3
***



View Profile Email
« Reply #37 on: October 18, 2011, 07:33:58 pm »

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.
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #38 on: October 19, 2011, 12:21:54 am »

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:


Logged

MOONMAN devlog WWW FORUM
Momeka_
Level 0
***



View Profile WWW Email
« Reply #39 on: October 19, 2011, 03:46:58 am »



I love it.
Logged

Pages: 1 [2] 3 4 ... 185
Print
Jump to:  

Theme orange-lt created by panic