Demo Map Using the Y Axis as the Z Axis: 2D Graphics

tooltiperror

Super Moderator
Reaction score
231
w0YsZ.jpg

If you haven't already, go and try out XANID by Uberplayer. It's really superb.

Well, I've always really wanted to make a platformer. After planning it for sometime, I realized my problem was that I had not yet figured out how I would make the physics work, or how to make the 3D game of Warcraft III into a 2D environment. I was stumped. Eventually I decided I wanted to make the units in the game sideways, have them walk along the X axis, and make the Y axis stand for height (aka the Z axis).

The way I was planning on doing this was by exporting every unit I was going to use, editing the model to be sideways, and importing it. Of course, this was an awful approach. It was rather wonky: it required a lot more work, for possibly worse effects. Next I came to a better approach, using [LJASS]SetUnitLookAt[/LJASS] on dummy.mdx, and attaching my units as models to the dummy. This was a step in the right direction, but I found units used as [ljass]effect[/ljass]s did not play animations, making the game ugly.

Eventually, I admitted that I was not smart enough for the job, and asked Uberplayer for assistance. Sir Uberplayerus gave me these eloquent words of advice:

I have two units for each object. Onea that faces right, and one that faces left. In the Object Editor the right unit has "Maximum Roll Angle (Degrees)" of -270, and the left unit has it -90. When the units are created, I set the right unit face 0 degrees, and left unit face 180 degrees.

And that was a way to edit their roll. Now, this is all grand and jolly, but every good animation needs that coding to go wit hit making it awesome. So in this demomap, there is thoroughly commented vJass showing you how I got this to work. The code uses KeyAction by Earth-Fury.

Word from the wise: compare zero to your variables, and take constructive criticism, for your code is made to be manageable not just fast, lest you become an ASMer in a world of high level programming.
 

Attachments

  • [Demomap] Y-axis as the Z-axis.w3x
    25.8 KB · Views: 407

PurgeandFire

zxcvmkgdfg
Reaction score
509
Great job. I love XANID, although I don't know if Uberplayer is still working on it.

As for the demo map, it demonstrates what it needs to and does it well. Would be cool to change the camera AoA to 270 but otherwise nice job.
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
You should use the ArrowKeyEvent library by Bribe instead.

The XANID map is really a demo. What 10 seconds of gameplay? Any ~25 year old nes game is much more fun to play [for example Contra =)] and
has much more responsive controls. I mean when you press the move left button it should move left, not when you hold it down...

Is this the technique used in this map (forgot it's name) where you use a rifleman with rocket boots and different weapons (shotgun, ak47, rocket launcher). The fuel of the rocket boots is really the foodlimit so it was it's capped at 300.

Edit: oh lol the XAIND map is actually protected...
 

Switch33

New Member
Reaction score
12
He did release one version of XANID that was unprotected.

View attachment XANID 0.2.L.w3x

Also he attached another version on page 11, post 128. (1.0.D)
I bet that one is more up to date; but I don't know how he does his versions.

Edit: The one i attached is more up to date then the one on page 11.
 

Bribe

vJass errors are legion
Reaction score
67
Yeah ArrowKey is way less overhead in every way than KeyAction. The demo map also glitches pretty heavily, the unit kept disappearing and would be more user friendly to let the unit move on a timer as keys are held down instead of having to spam press the arrow keys.

ArrowKey Glitch.png
 

tooltiperror

Super Moderator
Reaction score
231
> Great job. I love XANID, although I don't know if Uberplayer is still working on it.
<3

> You should use the ArrowKeyEvent library by Bribe instead.
I don't like the interface.

> The XANID map is really a demo. What 10 seconds of gameplay?
You can take it up with Uberplayer if you want, but not in this thread.

> The demo map also glitches pretty heavily
As it says in the demo map itself, the glitches were not solved to keep code simple. I wouldn't implement this as it is in a real map.

> Yeah ArrowKey is way less overhead in every way than KeyAction.
I have a funny feeling this really doesn't affect my map, other than some negligible effects I don't care about. I will agree that there is less "overhead" in ArrowKey, but that may be at the lost of code simplicity with KeyAction's many axis functions and constants, et al. perks I would use Earth-Fury's library for. You can discuss this in the ArrowKey thread, of course.

> move on a timer as keys are held down instead of having to spam press the arrow keys.
I'll definitely update the demo map to mention this, and add a second trigger. As I'm thinking about it, it is just as intuitive as registering events, but doesn't really have a place in the same script as the other method. But it's still important for this demo map to include it, or else it's not really accurate "documentation" of a feature of Warcraft III. So I think I'll add in this.
 

Switch33

New Member
Reaction score
12
I also always thought that switching the camera only to an side viewing camera (not switching y and z) would be better for some 2d maps. Not specifically a platformer though; more of a 2d combat type map with some 3d elements.

Selection of the units definitely needs to fixed. Locust at least fixes the error of right click. I really like the idea of using 2 units with different roll type angles so you can see the unit clearly going left or right. You should add a jump for the arrow key for testing sake when you get the next version out. : D
 
Reaction score
456
It's not a good idea to make the units locusts. It's rather hard to enumerate them afterwards. Better way is to disable selection via coding.
 

Bribe

vJass errors are legion
Reaction score
67
Since selection events have a huge delay, wouldn't it just make more sense to do different enumeration methods?
 

Bribe

vJass errors are legion
Reaction score
67
But then you have no selection at all? I suppose for a 2-D scroller it shouldn't have it though.
 
General chit-chat
Help Users
  • Blackveiled Blackveiled:
    I wouldn't know, I'm in Joliet, Illinois right now working. I left Houston area about 2 weeks ago lol
  • Blackveiled Blackveiled:
    Not permanently of course, just a temporary job.
    +1
  • jonas jonas:
    Glad you're ok @tom_mai78101
  • jonas jonas:
    @Blackveiled you know another word for permanent? temporary
    +1
  • Varine Varine:
    Briefly, he'll only be there for the interim. Like a stopgap of sorts, he'll be back home in short time
  • O Old Mountain Shadow:
    Hurray! Tom has reappeared!
  • The Helper The Helper:
    Happy Thursday!
  • Blackveiled Blackveiled:
    Yep. Just another fun night at work.
  • Varine Varine:
    Broke the nozzle on my 3d printer and I don't have another heater block. So... I guess I'm fucked on that this weekend
  • The Helper The Helper:
    that sucks i bet they are expensive
  • Varine Varine:
    Not really
  • Varine Varine:
    The entire hot end is like 20 dollars, I just can't get anymore until next week
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top