Jump to content
Official BF Editor Forums
Sign in to follow this  
cobrachoppergirl

Adding Buildings To Existing Map - I've Seen It Done - But How?

Recommended Posts

Something that excites me... it is possible to complete redesign BF2142 maps.... SERVER SIDE. Add or move new trees, roads, buildings, and so on! In fact, you could delete everything to leave yourself with nothing but ground, and build up a whole new level from scratch, and nobody would have to download a mod at all to play your new map.

On the BF2142 Demo side, there is a Japanese guy who has edited the Sidi Map to place all new static objects (buildings, catwalks, towers, shipping containers, antenna towers, barriers, and so on, in this case) inside the map. How in the world is he able to do this, I thought this was impossible?

What I know:

If you edit StaticObjects.con (inside levels.zip) and move the location of a buliding, or create a new on, you will only move the (invisible) collision mesh for the object. For example, if you move the coordinates for the bridge, the graphic rendering of the bridge will not move inside the game, but the invisible collision mesh for it will. If you then drive a jeep over it you will fall through, for example.

If, for example, you create a new helipad in StaticObjects.con up in the air, you only create the invisible collision mesh for it. You can then parachute onto it and stand on an invisible platform in the air.

The only objects inside StaticObjects.con you can move or add and actually have move in the game, are the two destroyable objects... "barrel_big_dest_c" and "crate_01_dest_c". If you move anything else it only moves the invisible collision mesh for it.

Of course you can move and add dynamic things such as vehicles, control points, spawn points, and other objects in GamePlayObjects. But StaticObjects has been a no go.

My assumption previous was that data is naturally stored and used on the client side and used by the client to render where these objects were in the game. That would make sense. And it would also mean it would be impossible to move these things inside the game because the client uses data it has locally to exclusively render these things.

But he's done it. I don't know how, using a map editor or what (I stick to editing text files).

So obviously the data for the graphic rendering Static objects are store SOMEWHERE ELSE. But where??? I have looked everywhere using file scanning tools on the uncompressed files("Seeker" is a good one) for the strings of buildings and can not find where this data is stored.

But it is not, or at least it is not used exclusivly to render static objects inside a map. I would not believe it if I hadn't seen it with my own eyes and taken screensnapshots. He completly build a new base out of buildings, without moving the original buildings existing in the map. All the original buildings still existed in Sidi in their original locations, he just added more to 'build up a super base'.

I've commented out my combat area, which adds access to a whole lot more real estate in the game, and I want to place some additional buildings and bases and so outside in the yellow zone.

So my question is.. what file is the data for this staticobjects like buildings stored in? Server side?

CHOPPERGIRL

http://air-war.org

Share this post


Link to post
Share on other sites
So my question is.. what file is the data for this staticobjects like buildings stored in? Server side?

in the map, it is stored in the server/StaticObjects.con file

if if understand you correctly

Share this post


Link to post
Share on other sites

No, that's what I thought to, that's where it SHOULD be... you would think.

Unless I'm having a totally blond moment and not seeing something that is there, if you change the X/Z/Y of any of the objects in staticobjects, other than the two destroyable objects, all you do is move their (invisible) collision mesh around. It won't move the actual item location inside the game. Only its collision mesh.

Which made me think, the client uses its own staticojbects file as to where to store these. Or so I believed. And that it would be impossible to change their locations server side.

Until I saw this guys map. If I find them, I will post links to screenshots of his server in the next reply, to show, he actually created new building locations inside the game server side....

Share this post


Link to post
Share on other sites

If you were having a "blonde moment"

you could move/add a static object and check in single player if the new addition worked

then try server side

Share this post


Link to post
Share on other sites

Here's screensnapshots of his server, you can TRIPLE click on the thumbnails to view the big 1600x1200 image... first you'll go to an intermediate 640x480 image, then just click on it to get the huge full size image

Screensnapshot index:

http://img5.imageshack.us/gal.php?g=screen075.jpg

The dead giveaway for you, that this is NOT the standard Sidi Power plant map... all his catwalks he's added to connect his new tower static object spawns:

http://img17.imageshack.us/img17/5641/screen089.jpg

http://img17.imageshack.us/my.php?image=screen081.jpg

And he did this all SERVER SIDE. There was no mod to download, nothing to install. He modded his demo server map somehow to be able to add new static objects.

If I could do this, I could wipe a whole map clean and start from scratch, building forests out of trees, redrawing roads, rebuilding bases from scratch, and so on, to make entire new maps server side in both BF2142demo and full game versions, and nobody would have to download or install a thing. The mapping community would explode (well not really, there are only a few developers I'm sure that mess around in bf2142. Still, it would open a world of possibilites. And it should work in BF2 as well. Why not?

And I don't think he's particularly a genius... he just either found information how to do this or did it inside a map editor. I guess map editor, because you ahve to figure out the X/Z/Y for this, and its hard, unless you've got some code inside your python that spits out your soldiers X/Z/Y every 10 seconds to the chat window. All my map modding I did the hardest way, guessing at everything and tweaking over and over, slowly lowering objects, reconnecting inside the game, twekaing again, repeating a hundred times until I had things placed just right.

The easier way is to place this code below strategically in your kicker.py code right after the line:

kicker_info.posHistory.append( { 'time': now, 'pos': ( cx, cy, cz ), 'rot': ( ca, cp, cr ) } )

# CHOPPERGIRL ShowPlayerPosition utility code

# show players position for finding places to put objects when making maps turn off display of position

# turn on by setting below 1 == 1: or off with 1 == 0:

if 1 == 1:

try:

mm_utils.msg_player( player.index, "x/z/y: %.5f/%.5f/%.5f Rot %.0f" % (cx,cy,cz-1,ca) )

except:

mm_utils.msg_player( player.index, "SHOWPLAYERPOSITION: failed to find soldier's position" )

I have yet to use my player position displayer actually to locate objects, but it works. I was already done with my map moving, and did it all the nasty super hard way. With the code above, you just walk around in the game, stand where you want to place an object, and write down the info it reports out to you, which you can then use to locate whateve object you want to place there

Share this post


Link to post
Share on other sites

Here is a screen snapshot of what happens when you move objects in the StaticObjects.con...

http://img17.imageshack.us/img17/1585/screen007h.jpg

Sidi Power Plant Full game map: Bridge is raised 20 meters in StaticObjects.con

Note: only the (invisible) collision mesh is raided, not the graphic rendering of it in side the game.

In this graphic, I am standing on the inviible collision mesh of the bridge (that has been raised 20 meters),

with a gunship aprked on it as well. You can see the graphic rendering of the bridge by the client

is still below. T. Hiragi has gotten this to work, and added new buildings in the map, SERVER SIDE,

so this can't be done with client side data, or somehow he is overriding the data and doing it server

side. But how?

Again, screenshots of his SERVER SIDE modded sidi map: http://img5.imageshack.us/gal.php?g=screen075.jpg

Share this post


Link to post
Share on other sites

if you move the statics... the lightmap shadows will still be there... and if you move the static object it should move the collision mesh as well...

did you clear your shader cache folder in your 2142 folder in your mydocuments folder?

Share this post


Link to post
Share on other sites

Shader cache... oh ... heck no... you mean, if I like change my resoltuions or a screen setting inside the client, after doing the change, and the client rerenders the scene before joining the game, poof, like magic, my objects will now appear... ARG!!!! Is that what was going on... or?

BUT NOPE. I tried that. Deleted all of the cache, reconnected, went through the 5 minute reshading/optimizing at the join screen, and still no changes inside the map. Everything is rendered in its default places, not its new coordinates.

Edited by cobrachoppergirl

Share this post


Link to post
Share on other sites

are you playing online or locally?

and i'm not sure about why you want to move buildings in a regular 2142 level?

like i said before the lightmaps will be messed up... you could move the buildings and re lightmap the map with 3dmax though...

or open the 2142 map and save as and rename it... then you could move the buildings without messing up the original 2142 map...

Share this post


Link to post
Share on other sites

Testing this on a local server on the lan. I mod files in a server folder in my desktop, relaunch server, reconnect to local IP of server using BF2142 client, either on same computer or a second one.

I want to move buildings in a regular 2142 map, because on the DEMO SIDE, we have to play the Sidi Map over and over and over and over and over again. After a year and a half, it gets nauseating. Recently, I commented out my combat area which opens up all this new 'badlands' out there, that I could build some new bases... there's plenty of space and some gorgeous little valleys. I could, for example, build a jeep race track, or a tank areana, or a little base for sniper fights, or make a forest, or best of all, experiment using all the buildings and objects that are present but not used on the Sidi map (like all these other trees, for example). I've already pushed my map as far as it will go with custom python code, custom mods for weapons (for example, my jeeps drop poison gas pellets, my air transports drop bombs, my pistols and sniper rifle and hover tank have a bigger punch, my parachutes are now drivable paragliders, the air transports drop paratroopers instead of pods, I've added lots more AA/lasar cannons and written the name of my server inside the game with destroyable crates... and all my vehicles... multispawn. Not to mention I've tweaked all the damage states to persist a lot longer, so my battlefield is littered with wreckage, and my explosions are bigger and more spectacular.

So I've gone with this map as far as I want to go... its tweaked to the max... and yet out there on my map lies all that empty realestate out there, that I can walk in and fly in and drive in, just teasing me... build here... build something out there. Even if a few small remote things... maybe even something crazy, like a 3dimensional arena of helipads and control points in the sky you fight over... or... a GEE BEE style air race track. My imagination and the number of static object models built into the demo (ug) are the only limit.

I'm not worried about the lightmaps.

Edited by cobrachoppergirl

Share this post


Link to post
Share on other sites

Ok, i dont really have any idea if what im about to say makes sense at all...im new to modding, but:

There is probably a file somewhere that when the map loads, it tells the client where the models will be and that it needs to put the textures on these models. idk but EA would be really stupid if they made it so that all the maps have the buildings and objects set to the same coordinates, but separately on the client and server, and so if u moved the texture the staticmesh or collisionmesh or whatever its called would just stay there, or vice versa...

I would think that they would have some code, or someone could write some, that would link the textures to the meshes...assuming the server has access to everything on the client, or at least to the textures. If that was possible, then whenever you moved the mesh of an object it would also move the texture on the client.

Share this post


Link to post
Share on other sites

I've been trying to do this on BF2 as well because I've seen it done on a demo server..

I too would like the ability to move/replace/delete/add objects on the map server side and let players join and see the same effect.

And, like you, I've messed with the static objects file for some testing.. same effect. Other players see the same that I do (collisionmesh only, invisible building) as well so I'm guessing it's not a cache issue.

I've even tried using Python to spawn the objects and replace existing ones, but it only worked on local (as I expected, anyway).

So far I think it will only work if the object is networkable.. not sure how else to get it to move with its mesh without it being networkable. That being said, the server I mentioned and the one you've put pictures of are both using non-networkable objects and they are moved around without an issue. I doubt this would work, but I wonder what would happen if you add the networkable setting in the objects_server.zip (or in 2142, StaticObjects_server.zip).

As a last resort I would suggest making a back up of the map and opening it in the editor, try to add a static that way, save it, remove the MD5 files, and see if that works. I would prefer a text way of doing it but I'm sure the editor would get the job done for sure.

Edited by Freeze

Share this post


Link to post
Share on other sites

ok...i realized theres some errors with my original idea, so heres an improved one:

As you all have probably noticed, when a vehicle's col mesh moves its texture moves with it. Well, my idea is to basically trick the client into thinking that a vehicle is a building, texture and all. Maybe even placing the vehicle in the exact same place as the original building just in case. But of course you would also have the vehicle spawn in another place too, or what would be the point.

To do this im guessing you would have to edit the col mesh of an existing vehicle so it resembles that of a building. Then set the server so that it tells the client that the vehicle is a building (an existing building), and then, hopefully, the client would show that vehicle as having the texture of a building. You would then be able to move it anywhere on the map and tweak it so that it cant be entered/moved.

Im sure its much more complicated than this but im trying to give an overall idea and i dont really have any experience with those details.

Share this post


Link to post
Share on other sites

My conclusion was that you could do it if you launched the server game from inside the full game client (ie, created a lan game inside the game client), but I could not do it using a dedicated server (the console server app).

Devilman sent me some files and they worked, he could make new buildings inside a map, as long as he used the full game client and created a lan game inside of it. Nothing special, just moving things around in the StaticObjects.com

But when you do this same trick in the files using the dedicated console app standalone server, it does not work, all you end up doing is moving the invisible collision mesh around.

Now, here's the bugaboo... I saw and have screen snapshots of a guy who did this on a BF2142 demo server... moving building around... BUT THERE IS NO WAY TO CREATE A LAN GAME INSIDE THE DEMO CLIENT...

so he had to be using the standalone console only dedicated demo server. Its the only way to create a multiplayer demo game. As the demo client has no feature to create a multiplayer game inside of it, like the full game.

So that means, it IS possible. I just have no idea how yet. My guess is he probably edited the BF2142 map using bfeditor. Which is messy and complicated.

I kind of have given up on it at the moment, since even if I get it to work, it may mean the clients might have to rerender their graphics every time they connected to my server, which would suck. I'm not sure on this however.

Edited by cobrachoppergirl

Share this post


Link to post
Share on other sites
My guess is he probably edited the BF2142 map using bfeditor. Which is messy and complicated.

Wouldnt adding new statics in the editor and manually adding them in text to the statics con file (like i did)

be the exact same thing ?

Share this post


Link to post
Share on other sites

Well a LAN game (local) will always work for the host, but not for the players joining.

Set up a network that allows other people to connect to your local (I use Hamachi) and when they join they won't see the same things you do as far as texture. The mesh will move but only the texture will for you, since you're the host and the files are different for you and not them.

You basically have the same problem just only you can see it this time.

There's still some other thing the owner of the demo server did, likewise in the bf2 demo server that I saw.

Edited by Freeze

Share this post


Link to post
Share on other sites
Testing this on a local server on the lan. I mod files in a server folder in my desktop, relaunch server, reconnect to local IP of server using BF2142 client, either on same computer or a second one.

I want to move buildings in a regular 2142 map, because on the DEMO SIDE, we have to play the Sidi Map over and over and over and over and over again. After a year and a half, it gets nauseating. Recently, I commented out my combat area which opens up all this new 'badlands' out there, that I could build some new bases... there's plenty of space and some gorgeous little valleys. I could, for example, build a jeep race track, or a tank areana, or a little base for sniper fights, or make a forest, or best of all, experiment using all the buildings and objects that are present but not used on the Sidi map (like all these other trees, for example). I've already pushed my map as far as it will go with custom python code, custom mods for weapons (for example, my jeeps drop poison gas pellets, my air transports drop bombs, my pistols and sniper rifle and hover tank have a bigger punch, my parachutes are now drivable paragliders, the air transports drop paratroopers instead of pods, I've added lots more AA/lasar cannons and written the name of my server inside the game with destroyable crates... and all my vehicles... multispawn. Not to mention I've tweaked all the damage states to persist a lot longer, so my battlefield is littered with wreckage, and my explosions are bigger and more spectacular.

So I've gone with this map as far as I want to go... its tweaked to the max... and yet out there on my map lies all that empty realestate out there, that I can walk in and fly in and drive in, just teasing me... build here... build something out there. Even if a few small remote things... maybe even something crazy, like a 3dimensional arena of helipads and control points in the sky you fight over... or... a GEE BEE style air race track. My imagination and the number of static object models built into the demo (ug) are the only limit.

I'm not worried about the lightmaps.

could u plz give me a few tipps how u made these ? i also made a mod for bf2. itz a totally fun mod and itz fully overloadet with funny stuff.

but i wanted to make a server side mod und go to the limits of possible. (makeing new buildings like u want is not nessesarry)

can u guys plz tell me what exactly is possible and what not ? ma clients crush back to desk if they connect.

i deleted the md5s und only replaced existing vehicles with other (on the map existing) vehicles.

i also want to mod the kids and weapons like i did in the orginal mod, but itz kinda hard finding out by trial&error what serverside is possible and what causes clients to crash.

any help would really help me out......kinda list whats possible changes and what not would be really helpfull.

thx (sry 4 bad english....)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×