Page 4 of 8
Re: Isömap
Posted: Fri Jan 25, 2013 9:02 pm
by sanjiv
Saegor wrote:sanjiv wrote:Have any of you run into unusual problems following this strategy?
i'm sorry but i don't understand the way you draw your cube, so i will take time to read your code and try to make some light on that
Aaah! No hurries, I'll confess I'm haven't gone in to make things super-readable. In fact, I'll take suggestions on how to document the code so it's more user-friendly. I do this as a hobby, so I'm not up to date on the "best practices."
And perhaps the following might help make sense of how I've done things.
1) Each face of the cube is drawn separately, and the order in which they're drawn changes based on the angle at which the axis is rotated (of course sometimes you're going to want to draw the top before the bottom, and sometimes you'll want to draw the bottom before the top).
2) Each surface is, first and foremost, a polygon. The points of that polygon are usually defined by an equation that's like "centerPosition+distanceToRigthFace+distanceToFrontFace+distanceToTopFace." Starting from the center, that would get you to the upper right, forward corner of the cube.
3) The "distanceToRightFace" value would be calculated using something like "(cube width/2) * scewFactorAlongX(orY). The scewFactor changes based on the angles of rotation.
Of course, all these distance values would have both x-axis and y-axis components.
EDIT: Rotation is currently a property of the Axis, and not the Box. I believe the Box has variables such that it CAN be rotated relative to the axis, but I haven't done anything with that yet.
Re: Isömap
Posted: Mon Jan 28, 2013 12:19 pm
by Saegor
thanks, now i understand more easily what you did
but, in fact, i feel comfortable with no texture because it add the retro look i wanted. i quickly made a version with a grid that surrond every squares but it take like 100%(!) more CPU so i don't know if i will continue in this direction. please everybody give me your advices : do you prefer the vanilla version or this one ?
EDIT : grid lines drawing is an ingame option in isömap 0.087 (press h)
Re: Isömap
Posted: Mon Jan 28, 2013 9:10 pm
by Darky
Grid Lines Off for me.
Re: Isömap
Posted: Mon Jan 28, 2013 9:13 pm
by Saegor
Darky wrote:Grid Lines Off for me.
why ? CPU charge or easthetical reason ?
Re: Isömap
Posted: Tue Jan 29, 2013 12:02 am
by Darky
For esthetical reason but also because they add nothing.. (to the gameplay I mean.. Grid Lines are just.. Useless...)
(CPU charge : on my old macbook : grid Lines ON ==> - 50% FPS. It's huge., so, in my humble opinion, there is really no reason to implement them (except for debug ?) )
Re: Isömap
Posted: Tue Jan 29, 2013 10:31 am
by Saegor
okay, i will keep it for debug/stupid option only
take it darky, a version only for you
![Wink ;)](./images/smilies/ms-wink.png)
free moves are definitively coming !
(yeah collisions are buggy but... i'll fix it soon)
Re: Isömap
Posted: Tue Jan 29, 2013 6:25 pm
by Darky
Yeah !
That's pretty cool !
I have two suggestions (I implemented it, see
https://dl.dropbox.com/u/95939/isomap_f ... _norm.love)
-> What do you think of "free-move according to the camera" ?
-> I also added speed normalization !
( speed=sqrt(dx^2 +dy^2 ) and it should be constant, if you move both directions, you should substract dx and dy by math.sqrt(2) in order to keep speed=1 !)
Code: Select all
function input_stream(dt)
(...)
if player_dir_h and player_dir_v then
norm=math.sqrt(2)
else
norm=1
end
(...)
if ke.isDown("right") then
player_dir_h=true
player_move(1/norm, -1/norm, 0, dt)
elseif ke.isDown("left") then
player_dir_h=true
player_move(-1/norm, 1/norm, 0, dt)
else player_dir_h=false
end
if ke.isDown("down") then
player_dir_v=true
player_move(1/norm, 1/norm, 0, dt)
elseif ke.isDown("up") then
player_dir_v=true
player_move(-1/norm, -1/norm, 0, dt)
else player_dir_v=false
end
(...)
end
btw : your code is really neat ! Congrats.
Re: Isömap
Posted: Wed Jan 30, 2013 7:26 am
by substitute541
I would suggest shadows. Like, darkening the cube that the player is over with (doesn't make sense I think). Because, It's kinda confusing.
Re: Isömap
Posted: Thu Jan 31, 2013 10:57 am
by Darky
Re: Isömap
Posted: Thu Jan 31, 2013 11:34 pm
by awhite92
this, is beautiful
keep up the awesome work
![Very Happy :D](./images/smilies/ms-glad.png)