Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411282 Posts in 69325 Topics- by 58380 Members - Latest Member: bob1029

March 28, 2024, 11:39:38 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsMoonQuest
Pages: 1 [2] 3 4 ... 189
Print
Author Topic: MoonQuest  (Read 1300232 times)
BadgerManufactureInc
Guest
« Reply #20 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 #21 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

Pemanent
Level 4
****



View Profile
« Reply #22 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 #23 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

Belimoth
Level 10
*****


high-heeled cyberbully


View Profile
« Reply #24 on: October 11, 2011, 05:50:29 PM »

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



Needs a themesong.
Logged

Pemanent
Level 4
****



View Profile
« Reply #25 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 #26 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

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #27 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

eigenbom
Level 10
*****


@eigenbom


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

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

Logged

negativeview
Level 0
***


View Profile
« Reply #29 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 #30 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

eigenbom
Level 10
*****


@eigenbom


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


Logged

Belimoth
Level 10
*****


high-heeled cyberbully


View Profile
« Reply #32 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

delete me
Level 0
***

This account is very old, I don't use it.


View Profile
« Reply #33 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 #34 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

Pemanent
Level 4
****



View Profile
« Reply #35 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 #36 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

Momeka_
Level 0
***



View Profile WWW
« Reply #37 on: October 19, 2011, 03:46:58 AM »



I love it.
Logged

twobitart
Level 0
***



View Profile WWW
« Reply #38 on: October 19, 2011, 06:21:08 AM »

decreased strut factor:


I like the little flick you get in his "hand" at the end of the walk cycle. And I totally love that the grass is affected by you as you walk. It's as if it's afraid of you stepping on it!
Logged

sabajt
Level 1
*



View Profile WWW
« Reply #39 on: October 19, 2011, 07:04:30 AM »

decreased strut factor:


I like the little flick you get in his "hand" at the end of the walk cycle. And I totally love that the grass is affected by you as you walk. It's as if it's afraid of you stepping on it!

It better be afraid, because Moonman might zap it with his invisible laser vision.  At least that's what I think is going on here  Tongue
Logged

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

Theme orange-lt created by panic