2D Level - Turning Fixed, Camera Placement Still An Issu
Moderator: Moderators
- Sky_216
- Droid Pilot Assassin
- Posts: 2086
- Joined: Mon Feb 13, 2006 3:28 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
2D Level - Turning Fixed, Camera Placement Still An Issu
Been thinking about this again...making a BF level in 2D (side scroller). Reasons behind it are (1) sidescrollers (shooting and platforming) are fun, (2) they look good in semi 3D (which BF2/Zeroengine certainly provides), (3) 2d is generally better for platforming than 3d and (4) it'd be something almost completely new for BF2.
There are problems.....but only two I can't work around. Anyone who knows how or has suggestions on how to get around them please post away.
1) Turning.
Limiting movement sideways is not a problem, neither is stopping units turning.....but changing what direction they face is.
The problem is that pushing the back key makes you walk backwards, but you need to turn to turn around. So is it possible to have a unit either (a) be forced to turn 180 degreed whenever it turns, (b) have some sort of dispensible weapon that switches its orientation or (c) change it somewhow so that pressing back causes a switch in direction.
-Fixed thanks to Zerted and Frisbeetarian.
2) Camera placement.
If (1) is possible then all that needs to be done is change the camera to look at you from the side (because turning switches what side your facing, level construction would have to be carefully setup so you don't get objects blocking your view)...but I have no idea how to do this. If (1) is impossible this isn't an issue, as pretty much the whole thing won't work.
There are problems.....but only two I can't work around. Anyone who knows how or has suggestions on how to get around them please post away.
1) Turning.
Limiting movement sideways is not a problem, neither is stopping units turning.....but changing what direction they face is.
The problem is that pushing the back key makes you walk backwards, but you need to turn to turn around. So is it possible to have a unit either (a) be forced to turn 180 degreed whenever it turns, (b) have some sort of dispensible weapon that switches its orientation or (c) change it somewhow so that pressing back causes a switch in direction.
-Fixed thanks to Zerted and Frisbeetarian.
2) Camera placement.
If (1) is possible then all that needs to be done is change the camera to look at you from the side (because turning switches what side your facing, level construction would have to be carefully setup so you don't get objects blocking your view)...but I have no idea how to do this. If (1) is impossible this isn't an issue, as pretty much the whole thing won't work.
Last edited by Sky_216 on Fri Jan 30, 2009 3:23 pm, edited 1 time in total.
- [RDH]Zerted
- Gametoast Staff
- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Obstacles for 2D BF2 Level...
I can quickly think of two ways you might be able to do part one through transportation.
Way 1) Use some type of dispensable or controllable weapon. When you drop/dispense what every it is exactly where the player is standing, the Lua script then teleports the player to that location. The player will be facing whatever direction the item was facing. Of course, now the trick it to dispense something that is facing backwards or turns around.
Way 2) Copy the player's matrix and directly change it to be facing directly backwards. Teleport the player to this new matrix. I believe you can directly edit the matrix through the scripts, but I've never tired it.
Way 1) Use some type of dispensable or controllable weapon. When you drop/dispense what every it is exactly where the player is standing, the Lua script then teleports the player to that location. The player will be facing whatever direction the item was facing. Of course, now the trick it to dispense something that is facing backwards or turns around.
Way 2) Copy the player's matrix and directly change it to be facing directly backwards. Teleport the player to this new matrix. I believe you can directly edit the matrix through the scripts, but I've never tired it.
- Sky_216
- Droid Pilot Assassin
- Posts: 2086
- Joined: Mon Feb 13, 2006 3:28 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Obstacles for 2D BF2 Level...
Could you explain way 2 in a bit more detail? What is the player's 'matrix'[RDH]Zerted wrote:Way 2) Copy the player's matrix and directly change it to be facing directly backwards. Teleport the player to this new matrix. I believe you can directly edit the matrix through the scripts, but I've never tired it.
- Frisbeetarian
- Jedi
- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Obstacles for 2D BF2 Level...
Couldn't you create a new animation to turn the unit around?
- Sky_216
- Droid Pilot Assassin
- Posts: 2086
- Joined: Mon Feb 13, 2006 3:28 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Obstacles for 2D BF2 Level...
I personally couldn't, but it seems like a simpler way to do it. Would it possible to make the secondary fire button turn you around, or to make the backwards key turn you around???Couldn't you create a new animation to turn the unit around?
- DarthD.U.C.K.
- Master of the Force
- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Obstacles for 2D BF2 Level...
yes, if you give them an anim that turns you around..
- Sky_216
- Droid Pilot Assassin
- Posts: 2086
- Joined: Mon Feb 13, 2006 3:28 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Obstacles for 2D BF2 Level...
DarthD.U.C.K. wrote:yes, if you give them an anim that turns you around..
180 degree turn? And would it be possible for you to make that (normal trooper with 180 degree turn on either block key or secondary fire key). I know it's a request but you seem to be one of the better animators.
- DarthD.U.C.K.
- Master of the Force
- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Obstacles for 2D BF2 Level...
do i?
i may think about it
i may think about it
- Frisbeetarian
- Jedi
- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Obstacles for 2D BF2 Level...
If the character is a hero, you could always map it to the block key.
- Sky_216
- Droid Pilot Assassin
- Posts: 2086
- Joined: Mon Feb 13, 2006 3:28 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Obstacles for 2D BF2 Level...
I'm assuming by that you mean 'if they have a lightsabre/melee weapon. Problem is though, I can't think of an existing anim that spins you 180 degrees. Also, that won't work if they have a gun, will it?Frisbeetarian wrote:If the character is a hero, you could always map it to the block key.
- Frisbeetarian
- Jedi
- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Obstacles for 2D BF2 Level...
I was actually thinking about it in terms of the control options in game, not in terms of modding. In any case, you're right. I'm not sure how the button maps work, but the control options in game probably mean that a gun has the options set aside for infantry and the melee has the options for Jedi. You could always try to use it with a gun, but I'm afraid that the same thing might happen to you that happened to Kit Fisto.
Maveritchell wrote:The .combo said that it was mapped to the "reload" button, I didn't think to check the secondary fire button instead (I suppose that reload just doesn't work and remaps itself to secondary by default).
- Sky_216
- Droid Pilot Assassin
- Posts: 2086
- Joined: Mon Feb 13, 2006 3:28 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Obstacles for 2D BF2 Level...
So...from what I can see two possible anim options for 1......
Have block (through .combo file) turn you around. Pretty sure it needs at least one new anim to get it to work.
Somehow have an anim where pressing the back key makes you run facing the other way. No idea if that is possible.
Have block (through .combo file) turn you around. Pretty sure it needs at least one new anim to get it to work.
Somehow have an anim where pressing the back key makes you run facing the other way. No idea if that is possible.
- Frisbeetarian
- Jedi
- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Obstacles for 2D BF2 Level...
Now that I think about it, if you're doing a side scroller, couldn't you just remap the movement keys to up being jump, right being move right, left being move left and down being crouch? This way you wouldn't need a new animation and your only problem is getting the camera to face your side and scroll with you based on which direction you move.
Looking through a few combo files, I see no reference to (or "right", "forward", or "back" in place of "left"; it could very well be "moveleft," etc. to distinguish from mouse commands), but that doesn't mean it's nonsense code. (I came up with this code based on the reference to the sprint; I figure that any keyboard button uses "down" while the mouse uses "press.")
Looking through a few combo files, I see no reference to
Code: Select all
Button("left", "down");
- Sky_216
- Droid Pilot Assassin
- Posts: 2086
- Joined: Mon Feb 13, 2006 3:28 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Obstacles for 2D BF2 Level...
Yes but the problem is if you walk sideways (left or right) you're strafing (gun pointed at same place), and if you walk backwards you aren't turned around, so there is no way to turn around. That's the problem.Frisbeetarian wrote:Now that I think about it, if you're doing a side scroller, couldn't you just remap the movement keys to up being jump, right being move right, left being move left and down being crouch? This way you wouldn't need a new animation and your only problem is getting the camera to face your side and scroll with you based on which direction you move.
Looking through a few combo files, I see no reference to(or "right", "forward", or "back" in place of "left"; it could very well be "moveleft," etc. to distinguish from mouse commands), but that doesn't mean it's nonsense code. (I came up with this code based on the reference to the sprint; I figure that any keyboard button uses "down" while the mouse uses "press.")Code: Select all
Button("left", "down");
So there needs to be a 'turn around 180 degrees' as well as backwards/forwards.
- Frisbeetarian
- Jedi
- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Obstacles for 2D BF2 Level...
True, I wasn't thinking, so unless you can call an animation inside a transition, you would have to create a new state such that if you press the left or right keys from idle, it calls the 180 degree anim and immediately transitioned back to idle.Skyhammer_216 wrote:if you walk backwards you aren't turned around
How do you solve the problem of having the user turn the gun with the mouse, since in a side scroller, once turned even a little the gun would shoot off into the oblivion of 3D? Do you override the set combo with one such that when you look right, nothing happens?
- Sky_216
- Droid Pilot Assassin
- Posts: 2086
- Joined: Mon Feb 13, 2006 3:28 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Obstacles for 2D BF2 Level...
Nope, just stop the player from being able to turn normally (TurnRate = 0)
- Frisbeetarian
- Jedi
- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Obstacles for 2D BF2 Level...
That makes sense. You've tested that I suppose, and it works?
For the camera, you'll have to work that via Lua. I'd look into the scripts for free camera (should be included in assets, as fake console is); I just don't have time to do it myself.
For the camera, you'll have to work that via Lua. I'd look into the scripts for free camera (should be included in assets, as fake console is); I just don't have time to do it myself.
Last edited by Frisbeetarian on Fri Jan 30, 2009 5:06 pm, edited 1 time in total.
- Teancum
- Jedi Admin
- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: Obstacles for 2D BF2 Level...
I'm not trying to say don't do it, but there's a few other things you'll want to think about. Here's my take on things thus far:
*The AI is built to be able to strafe and turn. Yes, you can turn that off in their odf, but you're severely crippling the AI's ability to fight.
*You're gonna need to have a way to force all units to a 2D plane. Even though you've got characters themselves forced to never turn there's a chance that explosions will throw them off. In that case you can use the built-in invisible blocks (I forget what they're called... com_inv_wall64.odf or something like that) to basically "squeeze" them in, keeping them from moving.
*The AI is built to be able to strafe and turn. Yes, you can turn that off in their odf, but you're severely crippling the AI's ability to fight.
*You're gonna need to have a way to force all units to a 2D plane. Even though you've got characters themselves forced to never turn there's a chance that explosions will throw them off. In that case you can use the built-in invisible blocks (I forget what they're called... com_inv_wall64.odf or something like that) to basically "squeeze" them in, keeping them from moving.
- Fiodis
- Master of the Force
- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Obstacles for 2D BF2 Level...
I probably won't be much help, and you've probably considered this already, but from what I read of the topic no one has mentioned it. That's either because everyone except me knows it won't work or no one has thought of it yet. I have no idea which it is, so here goes nothing....
What about how, in BF2, you can move the mouse around to change the direction you (and the gun) is pointing? You're talking about buttom maps and COMBOs and anims and a lot I barely understand (or not at all), but if you could, and you wanted it 2D, could you remove the button map or whatever it is that says "Y-axis movement of the mouse = look up or down"? And keep the bit that says "X-axis movement of mouse = look left or right"?
What about how, in BF2, you can move the mouse around to change the direction you (and the gun) is pointing? You're talking about buttom maps and COMBOs and anims and a lot I barely understand (or not at all), but if you could, and you wanted it 2D, could you remove the button map or whatever it is that says "Y-axis movement of the mouse = look up or down"? And keep the bit that says "X-axis movement of mouse = look left or right"?
- Teancum
- Jedi Admin
- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: Obstacles for 2D BF2 Level...
Truthfully this goes beyond a .combo file and into more complex lua scripting. I don't know how integrated lua is with the game, but if you can capture keystrokes or even vector based movement combined with the direction the player is facing you can turn the player around by teleporting them, like Zerted said.
But as I always say with loftier ideas: You can probably do it, but it's much more trouble than it's worth. Not to honk my own horn, but I should know, I've spent 10+ years working on small and large scale mods for games.
It really comes down to either 1) already being a LUA guru, or 2) being willing to commit hours on hours learning. And that's just to cover movement, that doesn't touch the hours planning out how a 2D level would work then planning out the level design itself.
Hey, I'm all for new ideas, but I'm all for being realistic too. Whether SWBF2 is a good candidate for a 2D scroller isn't really the issue, the issue lies in the fact that to do this even remotely right would take 40+ hours of concept work, THEN the level design after that.
But as I always say with loftier ideas: You can probably do it, but it's much more trouble than it's worth. Not to honk my own horn, but I should know, I've spent 10+ years working on small and large scale mods for games.
It really comes down to either 1) already being a LUA guru, or 2) being willing to commit hours on hours learning. And that's just to cover movement, that doesn't touch the hours planning out how a 2D level would work then planning out the level design itself.
Hey, I'm all for new ideas, but I'm all for being realistic too. Whether SWBF2 is a good candidate for a 2D scroller isn't really the issue, the issue lies in the fact that to do this even remotely right would take 40+ hours of concept work, THEN the level design after that.