Author Topic: Isometric Engine  (Read 28590 times)

0 Members and 2 Guests are viewing this topic.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Isometric Engine
« Reply #30 on: September 01, 2009, 10:25:05 pm »
well, what if one object is behind another?  This I think is why true Isometry has never been implemented, because while it might be easy to display the map, it is crazily hard to do anything with it.

Offline Seren

  • LV2 Member (Next: 40)
  • **
  • Posts: 20
  • Rating: +4/-1
    • View Profile
Re: Isometric Engine
« Reply #31 on: September 01, 2009, 10:52:25 pm »
Can't you make what I think is called a z-buffer? Basically, every pixel on the screen is assigned a value which represents their "distance" from the screen (row 1 could be distance 1, row 2 distance 3, row 3 distance 5, etc.), which would allow for objects with special outlines and stuff. The objects drawn onto the tiles could be given their own distances (If they are on row 1, give them distance 0, row 2 gives 2, row 3 gives 4, etc). That would mean 1-byte per pixel (not 1 bit). I think however that you could easily allocate 6144 bytes of free space in the ram. Of course, with z-buffering you wouldn't be able to use a library, given how slow they are (not that I know, I've never used them), and it would have to be written in pure asm, but hey, that's the fun part.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Isometric Engine
« Reply #32 on: September 01, 2009, 11:38:09 pm »
O.O

Um, yeah, I don't know asm, and this project was just using xLib, so I don't think that would work.

Offline Iambian

  • Coder Of Tomorrow
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 739
  • Rating: +216/-3
  • Cherry Flavoured Nommer of Fishies
    • View Profile
Re: Isometric Engine
« Reply #33 on: September 02, 2009, 01:23:48 am »
Can't you make what I think is called a z-buffer? Basically, every pixel on the screen is assigned a value which represents their "distance" from the screen (row 1 could be distance 1, row 2 distance 3, row 3 distance 5, etc.), which would allow for objects with special outlines and stuff. The objects drawn onto the tiles could be given their own distances (If they are on row 1, give them distance 0, row 2 gives 2, row 3 gives 4, etc). That would mean 1-byte per pixel (not 1 bit). I think however that you could easily allocate 6144 bytes of free space in the ram. Of course, with z-buffering you wouldn't be able to use a library, given how slow they are (not that I know, I've never used them), and it would have to be written in pure asm, but hey, that's the fun part.
If I'm to reply to that, I have to assume that this project is being written in ASM, which I am willing to give it a go.

It would be a bit easier to get calc84maniac to spill the beans as to how he did his Mode 7 engine. That would allow you some pretty cool effects like smooth rotations you see in FFT and the like. Of course, you can't do variable-height squares with that, but then again, that's part of the fun. To figure out how.

Now, let's get back to the BASIC side of things, which this project is actually being coded in.

I'm responding to Builderboy: Having known a logic pattern for building an isometric map, what sort of enhancements do you think Celtic III might need in order to ease the pain of performing these grueling operations? I think I've asked this before, but not in this fashion, but I really like to know. Something that would seem relatively simple in ASM might make a world of difference for what you're doing. Just gotta let me know what that something is. I am willing to help, but ...

Maybe I should just read up on the whole "how it's done" section on the previous page before rambling on any further. bbl </chatroom>

EDIT: Maybe something to help with the juggling of the buffers?
A Cherry-Flavored Iambian draws near... what do you do? ...

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Isometric Engine
« Reply #34 on: September 02, 2009, 01:45:59 am »
Isometric tilemap stuff would be cool as Celtic III feature, but would you have enough space?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Isometric Engine
« Reply #35 on: September 02, 2009, 01:54:08 am »
Hmmm, I can't think of anything right now...  And i don't want to ask for something thats super specific to this task. I know I have an efficient rendering engine, and fast vertical scrolling.  I have an idea of a project that could be realized with the current technology, maybe i will put together a small test demo...

Isometric is hard though, so I think it will be slow to do all those calculations and masking in anything other than asm

EDIT: Gosh, that would be crazy O.O not to mention difficult to design so that you could read from data structures and objects and stuff, and all through generic real( commands.  Seems for this kind of project a lot would need to be hand coded

Offline Seren

  • LV2 Member (Next: 40)
  • **
  • Posts: 20
  • Rating: +4/-1
    • View Profile
Re: Isometric Engine
« Reply #36 on: September 02, 2009, 04:02:33 pm »
I just realized that you don't need a z-buffer. All you have to do is

-Draw the tiles of the top row
-Draw the objects on the top row
-Draw the tiles of the second-highest row
-Draw the objects on the second-highest row
etc.

This would produce the exact same effect as a zbuffer, except without the 6144 bytes and individual bit checking.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Isometric Engine
« Reply #37 on: September 02, 2009, 05:33:33 pm »
That would work, but then whenever you needed to move an object, you would need t redraw the screen, which takes 40+ Tilemasking operations and screenshifts.  And display all of the objects over again.  For something like displaying a cursor in ISometric space, i think my previous method would be a lot faster. 

Also, for my previous object method, it can be drastically shortened if you don't have an object with black, clear, AND white.
It is assumed you have saved a picture of just the terrain

Clear Screen
Draw Object
Mask object with 3 overlaying landscape masks
Recall Terrain with OR


This could easily be fast enough to display an object with reasonable speed, as none of the objects are particularly taxing

Offline Seren

  • LV2 Member (Next: 40)
  • **
  • Posts: 20
  • Rating: +4/-1
    • View Profile
Re: Isometric Engine
« Reply #38 on: September 02, 2009, 06:23:49 pm »
Well, that's why I've never used libraries and don't use basic.

Edit: (sorry to anyone who was offended by this statement. It wasn't meant that way)
« Last Edit: September 02, 2009, 07:49:45 pm by Seren »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Isometric Engine
« Reply #39 on: September 02, 2009, 06:30:40 pm »
Well this project is being done in basic, so if you have a suggestion that requires me to switch to assembly, they won't be applicable.  The whole point of this project is pushing the limits of Basic and Basic Libraries.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Isometric Engine
« Reply #40 on: September 02, 2009, 07:16:27 pm »
True, plus at Omnimaga, we do not really encourage bigotry based on languages used nor programming language fanboyism (since it is rude toward people who just don't get assembly and still want to program games for calculators and in the past). I myself stuck with TI-BASIC during 8 years for that reason. However, I pretty much just do RPGs, so I barely even need speed. I think an isometric tilemapper would be possible in BASIC with the help of xLIB or Celtic, but it would probably take a lot of memory if you used masking, because you would need full of masks and stuff. If I made an isometric RPG, I would try to make sure to keep my maps layout in a way that my characters always walk in front of walls object as much as possible, and use no masking for tiny objects.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Isometric Engine
« Reply #41 on: September 02, 2009, 07:43:16 pm »
Yes thats true.  I myself never learned assembly, and I really have no intention to. :P Its just not my language.

On a slightly different note, I was fooling around and created some tiles with different heights for your visual enjoyment :)


I'm working on getting objects to display nicely, and use this to throw together a quick editor so I can make more nice maps :D

Offline Seren

  • LV2 Member (Next: 40)
  • **
  • Posts: 20
  • Rating: +4/-1
    • View Profile
Re: Isometric Engine
« Reply #42 on: September 02, 2009, 07:48:37 pm »
I apologize if I sounded insulting; it was never my intention.

What I suggest in order to increase the speed of your object method is to have a flag that determines whether the tiles in front of the character are going to be overlapping the object (in other words, is the tile "flat" or is it high enough to potentially obscure the object above it). While this might make the code longer, I would think that it would make it draw the object quicker (unless of course it's behind something, but I think the slight reduction of speed there would be worth the increase of speed in the other case).

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Isometric Engine
« Reply #43 on: September 02, 2009, 07:52:12 pm »
Yeah, thats probably going to be what I end up doing.  I could sort the objects from highest to lowest, so the test would be as simple as "If Object# > 8" or whatever.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Isometric Engine
« Reply #44 on: September 02, 2009, 08:19:25 pm »
looking good there Builderboy :P
/e