Isömap

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
sanjiv
Citizen
Posts: 88
Joined: Mon Feb 27, 2012 5:11 am

Re: Isömap

Post 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.
User avatar
Saegor
Party member
Posts: 119
Joined: Thu Nov 08, 2012 9:26 am
Location: Charleroi

Re: Isömap

Post 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)
Current work : Isömap
User avatar
Darky
Citizen
Posts: 66
Joined: Sat Jun 02, 2012 1:41 pm
Contact:

Re: Isömap

Post by Darky »

Grid Lines Off for me.
http://darky-ben.fr/Xut my webcomic (french)
User avatar
Saegor
Party member
Posts: 119
Joined: Thu Nov 08, 2012 9:26 am
Location: Charleroi

Re: Isömap

Post by Saegor »

Darky wrote:Grid Lines Off for me.
why ? CPU charge or easthetical reason ?
Current work : Isömap
User avatar
Darky
Citizen
Posts: 66
Joined: Sat Jun 02, 2012 1:41 pm
Contact:

Re: Isömap

Post 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 ?) )
http://darky-ben.fr/Xut my webcomic (french)
User avatar
Saegor
Party member
Posts: 119
Joined: Thu Nov 08, 2012 9:26 am
Location: Charleroi

Re: Isömap

Post by Saegor »

okay, i will keep it for debug/stupid option only

take it darky, a version only for you ;)
free moves are definitively coming !
(yeah collisions are buggy but... i'll fix it soon)
Attachments
isomap_freemoves.love
(4.91 KiB) Downloaded 294 times
Current work : Isömap
User avatar
Darky
Citizen
Posts: 66
Joined: Sat Jun 02, 2012 1:41 pm
Contact:

Re: Isömap

Post 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.
http://darky-ben.fr/Xut my webcomic (french)
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: Isömap

Post 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.
Currently designing themes for WordPress.

Sometimes lurks around the forum.
User avatar
Darky
Citizen
Posts: 66
Joined: Sat Jun 02, 2012 1:41 pm
Contact:

Re: Isömap

Post by Darky »

I tried something with collision : https://dl.dropbox.com/u/95939/isomap_f ... ltest.love (still buggy)
http://darky-ben.fr/Xut my webcomic (french)
User avatar
awhite92
Prole
Posts: 21
Joined: Thu Jul 26, 2012 4:25 am

Re: Isömap

Post by awhite92 »

this, is beautiful
keep up the awesome work :D
saved by a scholarship..
redesigned my "avatar"
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 54 guests