hello yall. im currently working on a fighting game. its goin pretty well. ive added a few of the best fighters ever made ever (chuck norris, hulk, Mr.T, bruce lee, bushido brown, m bison, steven segal, jean claude van damme. ect. [with their corrisponding special moves =P ]) as well as the option to make your own characters.
ANYWAYS. i need a camera that can follow 2 characters at once. what i have done is locked the z axis on the camera and “3rd person viewed” to an empty. now if i move the empty using an ipo. it pretty smoothly pans in/out/left/right but i cant figure out a way to make it so both characters are in view. anyone got any ideas? the map is going to be pretty huge. and once this is done i will share it with YOU ALL =)
and also. i cant figure out how to do motion blur. i have no 2d fliter option. am i on an older version of blender?
well depends, whats ur version? Newest is 2.56 (besides svns) and i better see techno viking in your game too
I’m not sure of what you’re searching, but I think you could find a camera script in “blengine’s old demo files” (just look in the game/demo topic in the WIP section). You can also look at the little game called “rvofighter” in the 2.25 game demos that you can find on the blender official website. For the 2d filters, you must have the 2.46 version, or a special SVN for the 2.45. By the way, your game project looks cool, and I hope you’ll do a mac version if you ever release it (as mac can run the blender .exe with the blenderplayer, you would just have to make controls that mac users could use (for exampe, avoid right click)). I’d really love to fight with Van Damme or Seagal!
Good luck, and sorry if you didn’t understand what I’m saying, I’m french, and my english isn’t very good.
PS : you can find it here : http://theboomshelter.com/crap/blends.zip. That’s the files -(killer)- is talking about.
If you need a motion blur click the link in my sig.
Also click on the Blender Resources link in my sig for some examples that may aid you.
Somewhere there’s a blender example file that has the following examples in it: Melee styled camera, multi-laps, speedometer, rain, grass, and like the slow parenting fix.
If anyone has a link, it may help this guy.
I’m sorry to up this thread, but what -(killer)- is talking about is exactly the same solution. You can find it here : http://theboomshelter.com/crap/blends.zip
thx yall. ive never heard of techno viking but for the help ill put him in =)
and ive tried running blender .exe files on a mac and it didnt work =\ if u know how ill make a mac version. or ill research it later =P either ones good.
OMG! you guys ROOOCCCKK! thx so much. ill give you sum thx in credits. =P
btw if u guys want characters u can pm me =)
Heres an idea for your camera. You can check the distance between the two characters and scroll the camera out accordingly.
cont = GameLogic.getCurrentController()
own = GameLogic.getCurrentController().getOwner()
character1 = GameLogic.getCurrentScene().getObjectList()["OBcharacter1"]
character2 = GameLogic.getCurrentScene().getObjectList()["OBcharacter2"]
camera_pivot = GameLogic.getCurrentScene().getObjectList()["OBcameraPivot"]
distance = character1.getDistanceTo(character2)
So you will have to do some calculations and work it out, the camera will focus on the middle of the 2 characters, so ‘distance/2 + leftMostCharacter.getPosition()[0,1 or 2 depending on axis]’ the height the camera focus on can be worked out using the average of the 2 characters z position, so ‘z = (character1.getPosition() + character2.getPosition()) / 2’.
I hope that helps.
btw, I used a camera_pivot, this can be an empty and parent the camera to this, I had some trouble manipulating the camera in python so I do it like that.
that’s a cool script/idea…
I decided to make an example blend, it works pretty decently except the setting of the y position needs to be tweaked a bit so it works perfectly.
You can move character1 with W - up, A - left, S - down, D - right. character2 will stay still. Hope this helps even more.
smash_bros_camera_example.blend (140 KB)
thanks alot the style from killer and vicmacs file slows the fps to around 15 and still doesnt work. obviously im doing something wrong. but i dont see how me doing it right would help the frame rate. but u never know… thanks alot andrew ill try it out.
update: thats pretty sweet andrew. its a bit sharp but probably because of the characters movement style. also i dont have a button to delay parenting >=( but thats probably okay ill update once ive used ur script. (crediting u =P)
update: …yeah… it doesnt work for some reason…i set everything up correctly (so i think) but the camera flys away when i press play.
update: OH YEAHH!!! u roccckk i had the z axis locked =P but now everythings good. thanks alot broseph.
update: alright. im going to have to make it so its a little more zoomed out than RIGHT on the character because its cutting off half of em =P i dunno if theres an option somewhere in there for that because im pretty crap at python but ill try to figure it out.
update: sweet. everythings good now. almost…PERFECT =). thx alot everyone.
PS. im going to definetly need that parent delay. anyone know what i can do?
Hey, glad that the camera stuff was of help.
You can manipulate parents using these commands:
The set parent takes an argument like this:
Tell me if you still need some help
nope everything is perfect. just played around with how much to add minus or divide by how far apart the characters are and everything is good. the camera starts a little low but if it goes any higher when u jump u can only see one character.
the map is pretty huge and the camera works perfectly from the farthest they can be ( top right to bottom left) to right up close. (which looks pretty damn cool.) lol.
well i think im going to start a new thread in “upcoming projects” or something like that.