Messing around with isometrics - more progress shots

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Exasperation
Prole
Posts: 11
Joined: Sat Oct 02, 2010 7:11 pm

Messing around with isometrics - more progress shots

Post by Exasperation »

Ran across LÖVE recently, and decided to see what I could do with it. Results of my first efforts:
Image
It's mostly from scratch (I made use of a modified version of TSerialize by Taehl, but everything else I wrote or drew myself). Left clicking on an unselected tile selects it, left clicking on a selected tile de-selects it. The scroll wheel increases/decreases the height of the selected tile. The save button does more or less what you would expect. The four arrows let you pan around to view the rest of the map. The map gets auto-loaded when you start.

Some things yet to do: allow text input of file names to save/load. Implement different terrain types and a way to change them (it stores the terrain type now, but there's only the one grass-over-dirt terrain at the moment). Allow different camera angles so you can see around stuff. Create an actual game to make use of the map(s) created. Replace the terrible graphics with... um... less-terrible graphics?
Last edited by Exasperation on Wed Oct 06, 2010 5:50 pm, edited 2 times in total.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Messing around with isometrics

Post by Taehl »

Looking good! Have you figured out collision? It can be a little trickier for an isometric game since you have to take the third dimension into account. On the other hand, its tile-based nature can let you take shortcuts, if you're crafty.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
Exasperation
Prole
Posts: 11
Joined: Sat Oct 02, 2010 7:11 pm

Re: Messing around with isometrics

Post by Exasperation »

I haven't even looked at collision yet. That's sort of in the "create an actual game" to-do item. Everything I had implemented as of the previous posting is listed in the post (I don't think I forgot anything, at least). Since then, I have gotten map rotation done, so now you can turn the map by 90 degree increments.

Probably the only interesting implementation detail so far is the way I'm handling screen-to-tile mapping. I'm using one of the 0.7.0 beta's new features to cheat at it.
Image
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Messing around with isometrics

Post by kikito »

I'm using one of the 0.7.0 beta's new features to cheat at it.
You are using a framebuffer, perhaps?
When I write def I mean function.
User avatar
Exasperation
Prole
Posts: 11
Joined: Sat Oct 02, 2010 7:11 pm

Re: Messing around with isometrics

Post by Exasperation »

Yeah. I use b for type of element and r+g for the individual element. So the buttons around the edge are colored 50,50,250 through 56,50,250 (and the next one will be 57,50,250), while the map tiles are colored 51,51,50 through 50+mapsize.x,50+mapsize.y,50. I've started working on a main menu, and on that mousemap the menu items (the only one there so far enters the editor screen) are colored r,g,255. So getting the element at a screen location x,y is just a matter of mouseMap:getPixel(x,y), and I don't need to worry about doing the math for when the mouse is over whatever arbitrarily shaped object I want to interact with.

Edit:
Another day, a little more progress. I got fed up with making graphics for gui elements for every thing I implemented, so I went looking online and found a free GUI construction kit. While I was at it I found a free font that looked decently readable, and grabbed that too. As a result, I still haven't gotten around to adding controls connected to the last few things I implemented internally, but the program at least looks prettier (screenshot shrunk down to 1/2 size to reduce filesize, it looks a little better at normal size).
Image
(And there is a lot of code cleanup and some additions behind the scenes, just no new exposed functionality.)
User avatar
headchant
Party member
Posts: 105
Joined: Fri Sep 03, 2010 12:39 pm
Contact:

Re: Messing around with isometrics - now prettier

Post by headchant »

This looks pretty neat.

Will it have any kind of depth sorting for the objects? From my experience isometrics can get really tricky when you have objects that are tall(e.g. taller than the tile), multiple tiles wide or want to have moving objects at the right depth.
This is for 0.7, right? I like your use of framebuffers and the map rotation.
User avatar
Exasperation
Prole
Posts: 11
Joined: Sat Oct 02, 2010 7:11 pm

Re: Messing around with isometrics - now prettier

Post by Exasperation »

Thanks!
I expect I'll have to implement some sort of depth sorting, yeah. Haven't really decided on how I want to do that yet, though. And yes, this is in 0.7 (has to be, since framebuffers are newly supported in 0.7).

Also, some more progress shots:
Image
This shows the (currently unimpressive) main menu, the brand-new terrain brush picking menu (entered by clicking on the image of the currently selected brush), and an example of multiple terrains + view rotation at work.
I've also got code in place (and tested) to handle larger cursor selection areas (changing height/terrain for multiple tiles at once), but I haven't put in the controls to let you change the size of the selection area yet.
User avatar
zac352
Party member
Posts: 496
Joined: Sat Aug 28, 2010 8:13 pm
Location: In your head.
Contact:

Re: Messing around with isometrics - now prettier

Post by zac352 »

redlock wrote:This looks pretty neat.

Will it have any kind of depth sorting for the objects? From my experience isometrics can get really tricky when you have objects that are tall(e.g. taller than the tile), multiple tiles wide or want to have moving objects at the right depth.
This is for 0.7, right? I like your use of framebuffers and the map rotation.
I'm wondering what you use those for...
Can't you just use love.graphics.setScissor(x,y,w,h)?
Hello, I am not dead.
User avatar
Exasperation
Prole
Posts: 11
Joined: Sat Oct 02, 2010 7:11 pm

Re: Messing around with isometrics - more progress shots

Post by Exasperation »

No, setScissor wouldn't do anything like what I want. setScissor restricts the drawing area to some portion of the display. If you look at this image again:
Image
That shows the contents of a framebuffer that is normally never displayed, only stored to an ImageData. This image is a projection of the normal contents of the display, but with everything colored according to what should happen when the mouse interacts with it. Since this particular framebuffer has the same dimensions as the actual drawing area, I can take the mouse coordinates, send them to this framebuffer (or rather an ImageData capture of its contents) using ImageData:getPixel, and get back the r, g, and b values that coordinate has in this hidden framebuffer, which indicate what interface element the mouse is interacting with (and saves me the trouble of finding out whether the mouse coordinates are within some (potentially arbitrarily shaped) area).

Another use for framebuffers is if you have a scene to display with some dynamic elements and a lot of complicated but static elements. You can draw all the static elements to a framebuffer once, then just draw the contents of the framebuffer + the dynamic elements to the screen every frame, saving yourself the recomputation of the static stuff every frame.
User avatar
Thursdaybloom
Citizen
Posts: 81
Joined: Mon Feb 15, 2010 3:43 am
Location: Australia

Re: Messing around with isometrics - more progress shots

Post by Thursdaybloom »

We spoke briefly about isometric maps in the IRC room and I'd be interested in working on this with you if you'd like.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 11 guests