rainy day? nothing to do on a friday night? bored? got house to yourself? ok, here's what you do: go close your door, lock it if you want to. you definitely don't want your parents walking in on this one. go to your computer and open up dream maker, we're going to have fun with objects!
oh gosh, not that kind of fun.
pervert.
ok, we'll get to the fun later. first, imagine this! (it sets up the fun part, so read it anyway. and actually, i'm not telling you where the fun starts so you can't just skip ahead to it. its not really a "fun part" either, because all of this is fun)
imagine that every z level of your map has a twin z level in a parallel universe. whenever something in the regular universe moves or changes, that movement or change is also done to that object's counterpart in the parallel universe.
simple to understand, right? ok, lets make it a little more complicated.
the people in the parallel universe don't move on their own. the objects in the real universe move, and when they move, they tell the corresponding object in the parallel universe to move too. this way, watching the parallel universe is just like watching the real universe.
still making sense? great. bring in some more convolution!
ok, lets start thinking of this in coding terms.
the real universe is the real world. its your BYOND map with your turfs, mobs, and objs. the parallel universe is just another z level (well, one z level per z level in the real world).
each atom in the real world has a variable which is a reference to an object. that object is located in the parallel universe. whenever something is done to the object in the real world, we must code the object to apply those changes to the object in the parallel universe. this way, watching the parallel universe is just like watching the real universe.
for example, your mob has a corresponding object in the parallel universe. it has the same icon and icon state as you. when you move, we need to make that object move too. when you move your mob, you'd move the object in the parallel universe to the same x and y as you, but their z coordinates would stay the same. if the z coordinates were the same, they'd be in the same universe. we want your mob and the object to be at the same x and y, but in different universes.
but, we created this parallel universe. it doesn't have to act like BYOND's universe. it will act how we tell it to act. we can do crazy things in this parallel universe. instead of making your object in the parallel universe move to the same x and y as you, we could make it move to world.maxx - x, y, so that it would be a mirror image of our universe.
we could even make this parallel universe be isometric.
the client's eye is in the parallel universe, so you never see the real world. each atom in the real universe has an object in the parallel universe, these objects are what you see. all we need to do to make the world look isometric is to find a way to calculate the positioning of the objects in the parallel universe.
BYOND map:
isometric map:
in the BYOND world, as you increase your x coordinate, you move to the right. as you increase your y coordinate, you move up.
there are many ways you can make the isometric map. you can make any corner of the map be (1,1). i usually choose the bottom-center of the map to be (1,1), but it really doesn't matter. also, since the x and y directions are on diagonals, there's really no intuitive way to decide which should be y and which should be x.
you just have to pick a system and go with it. the bottom-center of the map is (1,1). as you increase your x you move up and right. as you increase your y you move up and left.
the benefits of making the isometric map system like this is that you still move on a real map, so you can still use things like Move, Enter, step, walk, view, Bump, etc. also, each atom on the real map has an object representing it on the isometric map. this object on the isometric map is viewable by all players, so that the isometric map does not require lots of objects to be made for each player.
of course, since the same set of objects is what is being viewed by all players, you can't rotate the view. however, you could do some neat things, like lighting. and you can have moving parts, like moving platforms or something.
this doesn't fully explain anything, but i'm getting tired of writing, and i'd like to leave something for you to figure out.
ID:4851
Oct 25 2005, 2:39 pm
|
|
Oct 25 2005, 2:51 pm
|
|
Thats an amazing way too look at that, makes it easier to wrap my head around.
|