Author Topic: How to make your own maps.  (Read 48527 times)

Leandro

  • Elite Boss
  • *****
  • Posts: 310
How to make your own maps.
« on: December 31, 2012, 12:40:41 PM »
Well, Codewalker posted a tiny patch which allows you load files that the COH client normally wouldn't, so I guess I should bring you all into the exciting world of creating your own maps. The game has a built-in editor, but that requires a server, so your options are to edit the maps manually or make an external map editor. I won't be making an external map editor because I figure we'll eventually be able to use the in-game one, so here are some instructions to do it manually.

If you don't want to mess with hex editors yourself, click here to download the already-patched cityofheroes.exe for issue 24 beta. In order to make sure nobody thinks I added malware to it (or that the download site modified the file in any way) do the following:

* Rename your original cityofheroes.exe to cityofheroes.i24.exe and copy the linked cityofheroes.exe to the folder.

* Shift+Right click your City of Heroes folder. A menu will appear. Select Command Prompt here.

* Type in fc /b cityofheroes.exe cityofheroes.i24.exe

This will File Compare in /Binary the two files, and display the differences between the two files. Specifically, four bytes:

007237A8: F0 E4
007237AC: F0 D8
007237B0: F0 C8
007237B4: F0 C0

With that patch in place, you can go ahead and add maps to your data folder and play them from demos.

City of Heroes maps are simple text files. Good ol' Notepad can be used to create your own maps. The main problem is figuring out WHAT you want to put in the map. We'll start with the demo for our experiment; save this as mymap.cohdemo in your client_demos folder:

Code: [Select]
1 0 Version 2
0 0 Map maps/mymap.txt
0 0 Time 6
0 1 Player
0 1 NEW Puddle
0 1 NPC Puddle
0 1 POS 0 0 0
0 1 PYR 0 0 0
0 CAM POS 0 10 0
0 CAM PYR 0 -2.2 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0

This just loads the map and leaves the camera floating at 0,0,0 for 10 seconds. If you try to run the demo now, you'll just see the standard blue sky and nothing else.

Under the city of heroes folder, create the folder data if necessary, then a folder named maps inside it. Paste the following into a file called mymap.txt and save it there:

Code: [Select]
Version 2
Scenefile scenes/cityscene_stormpalace.txt

If you were to run the file now, you're still on an empty map, but you'll notice the sky is different; if the filename didn't clue you in, that's the Storm Palace's scene.  Scene files are stored in the piggs, but since you only need the filename, I put a list here. Just remember to put scenes/ before the actual file name.

If you can't see the Storm Palace sky when you run this demo, check your paths. Make sure you have client_demos/mymap.cohdemo and data/maps/mymap.txt

Note that scenes do more than just set the sky; they also do texture swaps. For example, the Winter scene turns a lot of grass textures into snow textures, and the Ruined scene replaced a lot of textures with their damaged counterparts. So, to avoid confusion, I'll be using the Altas Park city scene.

Moving on! We should have some solid ground under our feet. Time to Reference some geometry.

Code: [Select]
Version 2
Scenefile scenes/cityscene_atlas_park.txt

Ref grass_plate_flat_01
   Rot 0 0 0
   Pos 0 0 0
End

Ref grass_plate_flat_02
   Rot 0 0 0
   Pos 128 0 128
End

Ref grass_plate_rolling_01
   Rot 0 0 0
   Pos 128 0 0
End

Ref grass_plate_rolling_02
   Rot 0 0 0
   Pos 0 0 128
End

If you run the demo after saving mymap.txt, this is what you'll see:



It's not pretty, but it's ground. Plates come in many varieties, but here I used two flat ones and two irregular ones in diagonal. They are 128 units by 128 units, so I just placed them one next to each other, and that's what the Pos statements are about: placement. Rot is obviously rotation, which we'll see shortly.

Now, where did I get those geometry names? Here's the ugly part: they are not easy to get to, and there's not a list or a sample library... yet, anyway. It's one of those projects I have in the backburner, but I'll need help. So if you want to help catalog the game's geometry, post here! Basically I'd give you a list of geometry, you'd make a map containing one of the items (and just that item) and screenshot it, and so we'll slowly build a library of stuff. But I'm getting ahead of myself.

I'm going to use all flat grass plates because they're easier to handle, and then I'll add a little house. And some trees. This is when I opened Cameraman to help me find coordinates to place stuff in.

Code: [Select]
Version 2
Scenefile scenes/cityscene_atlas_park.txt

Ref grass_plate_flat_01
   Rot 0 0 0
   Pos 0 0 0
End

Ref grass_plate_flat_02
   Rot 0 0 0
   Pos 128 0 0
End

Ref grass_plate_flat_03
   Rot 0 0 0
   Pos 0 0 128
End

Ref grass_plate_flat_04
   Rot 0 0 0
   Pos 128 0 128
End

Ref rmn_bldg_04
   Rot 0 -2.5 0
   Pos 128 0 128
End

Ref conifer_sml1
   Rot 0 0 0
   Pos 156 0 95
End

Ref conifer_med1
   Rot 0 0 0
   Pos 136 0 94
End

Ref conifer_med2
   Rot 0 0 0
   Pos 95 0 129
End

Ref conifer_lrg1
   Rot 0 0 0
   Pos 105 0 166
End

If you run the demo now, this is what you'll see:



That's starting to look like something that might be usable in a demo. Or as the very basic beginnings of a city zone.

Note the use of the Rot command in order to make the house face the right way. Pos and Rot works the same as POS and PYR in demos, so if you're familiar with demos you should feel right at home with those two.

Oh, but how am I going to get into this zone? And for what purpose would I go into this tiny little map? Well, for an entry, we could use a portal. Portals are FX scripts, which those familiar with demo editing should already know. In order to use an FX, it has to be defined inside a group; so add these lines at the bottom of the map:

Code: [Select]
Def Portal
   Group Omni/PARTICLE_100
      Rot 0 0 0
      Pos 0 0 0
   End
   Type Scripted/Praetorian/Magic_Door/Magic_Door.fx
End

Ref Portal
   Rot 0 -1.21 0
   Pos 133 4 63
End

The Def command allows you to group several things together and then use them as a unit, but I won't be touching that topic on this post because it's already too long as it is. Suffice to day, you use Def with a name, and then group items inside. You can attach FX to one of the items using the Type command.

You will notice that the Pos and Rot in the group is 0. That's because the Def has its own little set of coordinates for grouping items. The Ref statement afterwards, which calls the group I just defined, places it in the right location with the right rotation.

Def names must be unique. That is, unique across the whole game. I used "Portal" here and it worked, but if there's already an item named "Portal" that you want to use, the Def would conflict. So if you want to make sure, add something unique to your defs, like grpMyPortal.

As for why go there, I have just the incentive. Add this bit to the end, then run the demo.

Code: [Select]
Ref Tourism_plaque_01
   Rot 0 0 0
   Pos 74 0 82
End



Where there's a badge, a badge whore is sure to follow.

And that concludes my first post on this topic. Certainly not the last. I just wanted to show you guys how easy it is to actually create your own maps from scratch (editing existing ones is a completely different story), and we really just need to start cataloguing all the existing map elements in the game.
« Last Edit: December 31, 2012, 02:43:50 PM by Leandro »

Leandro

  • Elite Boss
  • *****
  • Posts: 310
Re: How to make your own maps.
« Reply #1 on: December 31, 2012, 12:40:58 PM »
(Post reserved for Part 2)

If you want to help screenshot specific map elements, please PM me! There's TONS of things that need to be catalogued, and I could really use the help.
« Last Edit: December 31, 2012, 01:10:59 PM by Leandro »

Leandro

  • Elite Boss
  • *****
  • Posts: 310
Re: How to make your own maps.
« Reply #2 on: December 31, 2012, 12:41:18 PM »
    Some items to mess with

    Sparky collected the water/grass plates in this Photobucket album: http://s139.beta.photobucket.com/user/spectacular_sparky/library/Plates

    A water plate
    • OutsideWater_Smooth1024_NoSFX

    Grass plates
    • grass_plate_flat_01
    • grass_plate_flat_02
    • grass_plate_flat_04
    • grass_plate_flat_03
    • grass_path_str_01
    • grass_path_str_02
    • grass_path_str_03
    • grass_path_str_04
    • grass_path_4way_02
    • grass_path_4way_03
    • grass_path_4way_04
    • grass_path_4way_01
    • grass_path_3way_02
    • grass_path_3way_03
    • grass_path_3way_04
    • grass_path_3way_01
    • grass_path_bnd_02
    • grass_path_bnd_03
    • grass_path_bnd_04
    • grass_path_bnd_01
    • grass_path_end_02
    • grass_path_end_03
    • grass_path_end_04
    • grass_path_end_01
    • grass_slope_42ft_90in
    • grass_plate_rolling
    • grass_plate_bnd
    • grass_slope_42ft_90out
    • grass_slope_42ftslope
    • grass_slope_32ft_90out
    • grass_slope_32ftslope
    • grass_slope_32ft_90in
    • grass_plate_rolling_01
    • grass_plate_rolling_02

    Gothic buildings (screenshot by Sparky)

    These are large, with a footprint of at least 2 plates (256 units) per side.

    Cimeroran buildings (screenshot by Sparky)


    Old Town style buildings (screenshot by Sparky)


    Shiny skyscrapers from new Atlas (screenshot by Sparky)


    Shops and filler buildings (screenshot by Sparky)

    Notes: FillerShop_Garage is JUST the garage, to be added to the rest of a building; Z_Fillershop_Floors_* are to be attached on top of another building to make it taller.


    Paragon-specific buildings (screenshot by Sparky)


    Behavioural Adjustment Facility (screenshot by Sparky)




    Roads (2 lane) (screenshot by Sparky)


    Roads (4 lane) (screenshots by Sparky)


    Roads (6 lane) (screenshot by Sparky)


    Plates of different materials (for sidewalks, to place under buildings, etc) (screenshot by Sparky)


    Old Style Atlas Buildings (screenshot by Sparky)


    Rocks (screenshot by Sparky)


    Park walls (screenshot by Hotaru)


    Industrial Walls (screenshot by Hotaru)


    War Walls (screenshot by Hotaru)

    Blue war wall effects don't show in the screenies because of the stark white background, but should display correctly in a normal scene.

    Tunnels (screenshot by Hotaru)


    City Walls (screenshot by Hotaru)


    Ruined buildings (screenshot by Hotaru)


    Industrial Warehouses (screenshot by Hotaru)


    Factories (screenshot by Hotaru)


    NOTE: Many building won't show up unless they're called from Group. So in order to get it to display, you have to do something like this:

    [/list][/list]
    Code: [Select]
    Def myBuilding01
    Group deco_skyscraper_10
    PYR 0 0 0
    Pos 0 0 0
    End
    End

    Ref myBuilding01
       Pos 0 0 0
    End

    This happens for sure with all the others marked with an asterisk, and might happen with others. If the building is invisible, try putting it into a Def. Post 2 will have a proper exploration of Defs, but for now, just use them that way.
    « Last Edit: January 07, 2013, 03:27:58 PM by Leandro »

    Mister Bison

    • Elite Boss
    • *****
    • Posts: 686
    • *psychotic grin*
    Re: How to make your own maps.
    « Reply #3 on: December 31, 2012, 01:04:30 PM »
    HOLY RULARUU.

    If someone makes an external editor, or a patch to use the client to edit the map, call it RULARUU. For he is a creator of worlds. Like the costume creator is Icon.

    Also, I'm really sorry if this hurts you, brace for impact. Am I the only one to think that the game may be even better dead ? At least we have some good points out of our grief.

    Keep up the good work guys.

    EDIT: of course, this is discounting the firing of the whole of Paragon Studio, which is terrible. I'm really sorry for them and I'm happy it didn't end bad as they all got landings or bearings for one.
    « Last Edit: December 31, 2012, 01:12:24 PM by Mister Bison »
    Yeeessss....

    Turgenev

    • Underling
    • *
    • Posts: 13
    • Dead, but forever dreaming.
    Re: How to make your own maps.
    « Reply #4 on: December 31, 2012, 02:03:35 PM »
    I came. I saw. I came again.


    (taking notes on how to be more Leandroic in my life)
    "Remember. You CHOSE this death." - Lucifer

    houtex

    • Elite Boss
    • *****
    • Posts: 933
    • I was the turkey all along! MEE!
    Re: How to make your own maps.
    « Reply #5 on: December 31, 2012, 03:09:30 PM »
    I... man, I need time, but I am *SO* going to make the Original Adventure map now. :D

    /'cause the building reminded me of it... and the portal is the version what had xyzzy, lpwi, plugh... they'd be listed as separate zones to pick...

    ThorsAssassin

    • Boss
    • ****
    • Posts: 161
    Re: How to make your own maps.
    « Reply #6 on: December 31, 2012, 03:27:56 PM »
    Dammit Leo!

    lol I never thought this was even possible so I was trying to make due, this....changes everything for the video I have been working on for 3 months...

    *deletes all demofiles and starts over* GAAAHHHHHH

    Hotaru

    • Lieutenant
    • ***
    • Posts: 77
    • Just a demo-loving fool in the Far East...
    Re: How to make your own maps.
    « Reply #7 on: December 31, 2012, 03:31:31 PM »
    This is simply awesome. I see good things coming out of this. Really, really good things.

    Leandro

    • Elite Boss
    • *****
    • Posts: 310
    Re: How to make your own maps.
    « Reply #8 on: December 31, 2012, 03:32:50 PM »
    Dammit Leo!

    lol I never thought this was even possible so I was trying to make due, this....changes everything for the video I have been working on for 3 months...

    *deletes all demofiles and starts over* GAAAHHHHHH

    I don't recommend creating a large map with just the instructions I posted above or you'll lose what little sanity you have. I should know, I haven't seen mine in years.

    If you need to find the geometry names for something specific, let me know. The file defnames.bin (inside bin.pigg) has a list of EVERYTHING, but it's kind of hard to find something specific because the names are a bit of a mess.

    Leandro

    • Elite Boss
    • *****
    • Posts: 310
    Re: How to make your own maps.
    « Reply #9 on: December 31, 2012, 03:33:20 PM »
    This is simply awesome. I see good things coming out of this. Really, really good things.

    Goal #1: let's make a mother@#$&ing moonbase.

    ThorsAssassin

    • Boss
    • ****
    • Posts: 161
    Re: How to make your own maps.
    « Reply #10 on: December 31, 2012, 03:39:02 PM »
    I don't recommend creating a large map with just the instructions I posted above or you'll lose what little sanity you have. I should know, I haven't seen mine in years.

    If you need to find the geometry names for something specific, let me know. The file defnames.bin (inside bin.pigg) has a list of EVERYTHING, but it's kind of hard to find something specific because the names are a bit of a mess.

    I am just going by what ya posted ^ there, that screenie. Was trying to use Croatoa to give the feeling of a farm with a barn in it, basic stuff but I had to deal with the pumpkins and this is supposed to be old Norse. Then I wanted to do an old village based on Norse and was going to use Cimerora.

    Now just from what ya got there, I can pretty much do it and stay minimal.

    Also wanted a Valhalla but was going to use Cimerora's temple for that as well. Now maybe not...

    I love and hate you equally Leo...Bastard



    Goal #1: let's make a mother@#$&ing moonbase.

    @#$& yes!

    Leandro

    • Elite Boss
    • *****
    • Posts: 310
    Re: How to make your own maps.
    « Reply #11 on: December 31, 2012, 03:47:24 PM »
    Was trying to use Croatoa to give the feeling of a farm with a barn in it, basic stuff but I had to deal with the pumpkins and this is supposed to be old Norse.

    Oh, there's something you should know, if the pumpkins were the problem.

    If you open the map in a binary hex editor, you can change the names of stuff you don't want to an invalid name, and then they won't show up.

    For example, in Remains, I had a lot of rubble in the Atlas map, and ruined buildings. So, I opened the binary map with a hex editor, located all instances of "Rubble" and changed it to "FckOff". Next I loaded the demo, no more rubble. I did a similar trick to get rid of the ruined buildings and such.

    If you just needed to get rid of the pumpkins, it would have been really easy to edit the Croatoa map to remove them.

    Then I wanted to do an old village based on Norse and was going to use Cimerora.

    I dumped some Cimeroran buildings, maybe they'll help. See the third post.
    « Last Edit: December 31, 2012, 04:54:30 PM by Leandro »

    Globetrotter

    • Boss
    • ****
    • Posts: 169
    • I am a still Hero and This is what I do!
    Re: How to make your own maps.
    « Reply #12 on: December 31, 2012, 04:02:18 PM »
    O my goodness, we need a new global channel now: Map Editors with the message of the day: "We are going to the moon"
    Gutta cavat lapidem, non vi, sed saepe cadendo.

    Leandro

    • Elite Boss
    • *****
    • Posts: 310
    Re: How to make your own maps.
    « Reply #13 on: December 31, 2012, 04:50:45 PM »
    O my goodness, we need a new global channel now: Map Editors with the message of the day: "We are going to the moon"

    Why not?



    (Threw that together in 10 minutes, I'm aware it looks like crap :P )

    Riff

    • Lieutenant
    • ***
    • Posts: 84
    Re: How to make your own maps.
    « Reply #14 on: December 31, 2012, 07:33:05 PM »
    this looks really cool...

    but I'm gonna as the bleedin' obvious question here:

    Is this something we can build ourselves, and then swap, so we can effectively play in a limited fashion, in a collaborative effort? ie make maps, and then upload them, and exchange them with our fellow fans?

    Leandro

    • Elite Boss
    • *****
    • Posts: 310
    Re: How to make your own maps.
    « Reply #15 on: December 31, 2012, 07:36:25 PM »
    this looks really cool...

    but I'm gonna as the bleedin' obvious question here:

    Is this something we can build ourselves, and then swap, so we can effectively play in a limited fashion, in a collaborative effort? ie make maps, and then upload them, and exchange them with our fellow fans?

    For demos you can already do that, just distribute the map with the demo.

    For actual game play, we need a working server first, but once that's in place, server people can add maps, no problem.

    Arachnion

    • Elite Boss
    • *****
    • Posts: 639
    • Professional Cynic
    Re: How to make your own maps.
    « Reply #16 on: December 31, 2012, 07:59:37 PM »
    Yes yes yes.

    Seems like a lot of work, but very cool nonetheless.

    Is this your "very ambitious" project Codewalker mentioned a while back?

    ;)
    I'm all dressed up with nowhere to go
    Walkin' with a dead man over my shoulder

    Waiting for an invitation to arrive
    Goin' to a party where no one's still alive

    Leandro

    • Elite Boss
    • *****
    • Posts: 310
    Re: How to make your own maps.
    « Reply #17 on: December 31, 2012, 08:09:15 PM »
    Is this your "very ambitious" project Codewalker mentioned a while back?

    Sort of, this is more a symptom of that project. I've become way too familiar with the map format because I have been finishing some of the incomplete zones left in the i24 beta. They will be ready in all their glory when the community server opens.

    Codewalker

    • Hero of the City
    • Titan Network Admin
    • Elite Boss
    • *****
    • Posts: 2,740
    • Moar Dots!
    Re: How to make your own maps.
    « Reply #18 on: December 31, 2012, 11:08:38 PM »
    Just a heads-up, if you're making maps that you want to be able to use in-game eventually, you need to group things in Defs.

    Using Refs for object library pieces directly is okay for demo playback, but there are certain client-server interactions that will get very upset with you if you have a million top-level Refs, so it's best to keep them to a minimum. Also, as you found, certain object library pieces doesn't work from a Ref (offhand I think it's ones that use a single geo directly rather than wrapping it in a group).

    In general, most of the existing maps have all of the world geometry grouped into a Def called "Geometry", and then have subgroups inside of that for chunks of the map. They also have other top-level layers for various things like spawn points, badges, etc. There are a few exceptions, mostly for geometry that can be hidden or shown dynamically, like the Ski Chalet.

    Def names also have to be unique with respect to the object library (which is everything in defnames.bin), but they don't have to be unique across individual maps, as those maps are never loaded at the same time.

    Here's the text form for the map I posted earlier made out of the new office tileset pieces:

    Code: [Select]
    Version 2
    Def grp_test
    Group Villain_Lairs/M_Office/trays/lobby/Mission/M_Office_MIS_Lobby_01
    PYR 0 90 -0
    Pos 0 0 0
    End
    Group Villain_Lairs/M_Office/trays/halls/Mission/M_Office_MIS_3wy_Win
    PYR 0 180 0
    Pos 0 0 312
    End
    Group Villain_Lairs/M_Office/trays/halls/Mission/M_Office_MIS_Str
    Pos 0 0 184
    End
    Group Villain_Lairs/M_Office/trays/rooms/Mission/M_Office_MIS_Rm_3wy_02
    PYR 0 -90 -0
    Pos -128 0 312
    End
    Group Villain_Lairs/M_Office/trays/halls/Mission/M_Office_MIS_Ofc_Room_Win
    Pos -256 0 312
    End
    Group Villain_Lairs/M_Office/trays/lobby/Mission/M_Office_MIS_Lobby_02
    PYR 0 180 -0
    Pos -416 0 312
    End
    Group Villain_Lairs/M_Office/trays/lobby/Mission/M_Office_MIS_Lobby_03
    Pos 160 0 312
    End
    Group Villain_Lairs/M_Office/trays/halls/Mission/M_Office_MIS_Room_Conference
    PYR 0 -90 -0
    Pos -128 0 456
    End
    Group Villain_Lairs/M_Office/trays/halls/Mission/M_Office_MIS_End
    Pos -128 0 520
    End
    End

    Ref grp_test
    Pos 0 0 0
    End

    I had compiled it to geobin since the rest of the instructions weren't quite ready yet. :)

    Golden Ace

    • Boss
    • ****
    • Posts: 170
    • Moon Zone Damn it!
    Re: How to make your own maps.
    « Reply #19 on: December 31, 2012, 11:13:55 PM »
    Why not?



    (Threw that together in 10 minutes, I'm aware it looks like crap :P )

    How dare you say that looks like crap.

    That is awesome.

    I finally have my moon zone.  ;D
    ♫Sometimes you feel like a Tank, Sometimes you don’t!♪