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: 417

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
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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