I have been trying to figure out the lesser-known isometric side of BYOND, to hopefully create a working skeleton for an RTS game. However, the default movement direction when in isometric mode is only suitable for games like Q*bert, not mouse controlled, real time strategies like Starcraft or Age of Empires.
What I am trying to do is override the default direction that the player's mob moves when pressing an arrow key (if it also corrects the movement of player controlled "unit" mobs, then that's even better). The goal here is to make it so that movement acts like it does in normal mode, even though you are really in isometric mode. In other words, pressing the "Up" key, for example, moves the map Up, even though Up is really Northwest.
Basically, each direction of movement would need to be output as rotated 45° counterclockwise. I have tried playing with the North(), South(), procs etc., but I just ended up with runtime errors each time I pressed an arrow key. So I decided to come here for some help. I can imagine that others might find the solution to this useful as well. Something like this is pretty much required for making isometric RTS games.
Any help with this would be awesome!
I am still learning Dream Maker, so sample code would also be helpful.
ID:154845
![]() Dec 3 2011, 2:36 am
|
|
Nah, the loc var needs to change as well.
var new_dir = turn(dir, 45) |
I see. I wasn't sure if it is the current or new location of the mob. It may not even matter in pixel movement. The reference is not very descriptive about its expected value.
|
Thanks guys! That does exactly what I want to do as far as the player's mob is concerned. However, moving up and down the map is slower than left and right for some reason. I suppose that could be caused by Dream Maker's way of simulating movement through depth in isometric mode.
Also, after some experimenting, I believe that to get multidirectional, player controlled, mob icons to match up properly with this, you would need to either switch the directions of frame sets 45° CLOCKWISE in the icons themselves, or just code that in somehow. I have tried this with Deadron's DragSelect library, which he apparently removed sometime after I downloaded it, and I noticed that player controlled units seem to hop very slowly to their destinations, instead of going there smoothly like they are suppose to, but I'm sure that's just a bug I would need to correct within the libraries. Now I feel like movement direction should be fixed on the level of the Dream Maker program itself. I think there should be some world setting to keep normal movement for games like these without having to go through all these obstacles and overrides. Edit: Actually it was Mistaken's DragSelect library lol. It's just that it relies on several of Deadron's libraries, so it's quite the monster. http://www.byond.com/developer/Mistaken/SelectionDemo |
I recently found out about the special TOPDOWN_LAYER that can be used with isometric mapping, but from what I can tell it doesn't seem to have any properties different from other layers. I am still very new to using layers so forgive me if I sound like a noob.
There are some strange effects I have noticed when placing mobs on a TOPDOWN_LAYER. It's almost as if they are floating on some kind of bubble, and when you scroll the map up and down they slide left and right, and vice versa. I imagine this is probably due to them being on a higher z-level. So is it possible to force mobs on a TOPDOWN_LAYER to be on the same z-level as the isometric map? Also, like I said, there doesn't seem to be any difference between using TOPDOWN_LAYER or any of the other so-called "special" layers. Setting the player's mob on this TOPDOWN_LAYER does not make it move like it would in a TOPDOWN_MAP. Should that be the case, and could a TOPDOWN_LAYER be used instead of the code you provided? |
I'm not really sure if the loc var should be retained.