Map making questions

The place to discuss all things Lugaru.
Post Reply
User avatar
»StaffShock«
Posts: 173
Joined: Sat Mar 18, 2006 11:13 am
Contact:

Map making questions

Post by »StaffShock« » Sun Apr 09, 2006 4:00 pm

I have two questions about making maps which are getting really annoying.

What good are pathfind waypoints? I tried placing them around, over, and through an object the enemies had trouble getting around, but there was no change. I think these are supposed to be the path the enemy follows after it's fought you, lost sight you, and lost its path, but that doesn't seem to make any sense.

Also, how do you get dialogue to work? I've tried multiple times to load a pre-done dialogue file just for a test, and it started acting weird. The exact words I entered in the console were <dialogue Example.txt> without the arrows. It didn't make a sound or anything when I pressed enter, and when I got out of the console the whole screen turned red. When I went back into the console, the screen stayed red, save the text telling me I was in debug mode, the map-editing text, and the console text. Everything kinda gets video-echoey, like motion blur, even the console text. Whenever I enter the same thing in the console again, the redness and video-echo goes away, but then everything, scenery, bunnies, everything, goes away except the skybox. It's really messed up, and it's getting annoying since I'd like to add some personality to my maps.

Sorry about all the questions, and I know I'm probably getting annoying with all the posts, but you guys are the only Lugaru community I know of.:wink:

Silb
Master cartographer
Posts: 558
Joined: Sat Dec 10, 2005 10:03 am
Location: Map Guild

Post by Silb » Mon Apr 10, 2006 1:11 am

Pathfind waypoints are supposed to help bunnies find their way around. I suppose, something like: if they're stuck, they look for the closest path point to them, and follow the pathfind lines to the closest point to their destination (easy graph algorithm). I also think they don't always work :roll: . I was never able to get the wolves not to remain stuck on the edges in the Ice Cave.

Dialogues: as far as I know, several people have tried, and it always crashes (except for David. Fair enough, because the map editor is unsupported). I just wrote the dialogues in a text file, and copy-pasted them into the original campaign levels with a hex editor. There are several very helpful tricks to squash related bugs. I'll be happy to detail if you or anyone undertakes a campaign.

User avatar
»StaffShock«
Posts: 173
Joined: Sat Mar 18, 2006 11:13 am
Contact:

Post by »StaffShock« » Mon Apr 10, 2006 5:53 am

What do you mean by a squash related bug?

So for the dialogue, the only things you changed were the names, colors, and text. Right? Why did you need a hex editor for the copying and pasting?

EDIT: Disregard my first stupid question. You mean squash as a verb, not a noun.:lol:

Silb
Master cartographer
Posts: 558
Joined: Sat Dec 10, 2005 10:03 am
Location: Map Guild

Post by Silb » Mon Apr 10, 2006 10:21 am

»StaffShock« wrote:What do you mean by a squash related bug?
Ask Garfield about spiders.

You need a hex editor to set the byte before the string to the length of the string, and to be able to change some other things, like color or sound.

User avatar
»StaffShock«
Posts: 173
Joined: Sat Mar 18, 2006 11:13 am
Contact:

Post by »StaffShock« » Mon Apr 10, 2006 2:56 pm

But... all the dialogues are stored in text files. Not that I'm trying to contradict you, but I don't see why you couldn't just change the dialogue files that are already there to suit your needs and use them.

User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Post by rudel_ic » Mon Apr 10, 2006 3:11 pm

No, they aren't. There's just one example for a dialogue. The actual dialogues themselves are stored in the level file - meaning the map file.

An example is Data/Maps/start1 - just open it with a hex editor, you'll immediately see the dialogue. start1 is a map file.

User avatar
»StaffShock«
Posts: 173
Joined: Sat Mar 18, 2006 11:13 am
Contact:

Post by »StaffShock« » Mon Apr 10, 2006 5:14 pm

Yeah, I just got a hex editor and I see what you did. But how did you change who was saying what? Did you just change the skins and push around the guys without deleting them? Or can you switch who's saying what and make new people? I guess you'd have to do that for the level with the almost dead Garret.

I know my questions are most likely drilling a hole in your brain. My ignorance is more than your knowledge, I'd bet. But I do want to get better at this stuff.

Silb
Master cartographer
Posts: 558
Joined: Sat Dec 10, 2005 10:03 am
Location: Map Guild

Post by Silb » Tue Apr 11, 2006 10:38 pm

I'm trying to answer, but I can't post on the wiki, so I'm flooding everything in here instead. Watch out.

CAMPAIGN EDITION

I just put some tricks here that I hope may help you if you undertake a campaign. I did lose a lot of time before finding some of these. You'll need to know how to use a hex editor, as well as regular map edition.

================ MORE MAP EDITION ================

----- Undocumented Map Edition ----- (Mainly bugs.)

> Feature: Hitting control-delete deletes the object whose center is closest to you. Highly useful, undocumented.

-Related Bug: Doesn't work with the very first object created in the map, so make it a dummy object (like a 0.1-size rock below ground level).

-Related small detail: Technically, this doesn't delete the object from the level object array, it just replaces it with a void object. So a) if you use the regular "delete" feature back to the point where you created the control-deleted object, you'll still delete something invisible b) Don't use control-delete when you can use delete. However, delete and control-delete dont make any difference outside of the map editor (including framerates).

> Feature: There's a trick to make a crashing level work again (yes there is), provided you have a reasonably recent, working backup.
I'm not talking about a level crashing after you hex-edited it, because in that case, you're the bug. I'm talking about a level that has ceased to work after you modified it with the map editor.

In my experience, this actually only happens when the original level contained dialogue, and all you need to do is restore the dialogue data from your backup. Open your hex editor, and copy everything from the beginning of the backup until 3 bytes before the first occurence of the string "Data:". Select the same data (from the beginning of the file until 3 characters befor the first "Data:" string) in your crashing level file. If the length is the same, you win. Just paste the data you've copied from the backup. Otherwise, that backup was too old, and you lose.

As strange as it may sound, this has always worked for me, ie if "you win" then the level does work again.

> Bug: There are maps that, at some point, begin to always produce crashing saves when you open and save them, whether you actually modify them or not. The fix for this is just above. I can see it from here.

> Bug: Sometimes when you create an object touching the ground, you shrink to your knees near it, and enemies that walk past it follow strange trajectories. This can be extremely annoying, until you realize it permanently disappears once you reload the level.

> Bug: Sometimes, you can't walk from one object to the next although the edges are reasonably well adjusted. This is the same bug as just above.

> Bug: Fires can 1) work 2) not work 3) sometimes work. This changes in strange ways in the course of level edition. I haven't found a fix.

----- Architecture and Precision Work -----

> Feature: B button. This activates slow motion, and is very good when you need any kind of precision whatsoever. It also slows down the speed at which angles and size change when you press the arrow keys.

> Feature: C button. Blocks the camera at its current location, so if used properly, makes it much easier to see what you're doing when trying to place several objects with respect to each other. Movement is not relative to the camera anymore, but air-control still is, so if you can't get used to the movement, jump straight and air-control.

> Feature: Control-delete, again. Creating temporary platforms and such to help place or align other objects is a major help.

> Feature: If, for instance, you've created a platform and want to add a 'chimney' as a pillar, you won't be able to get out of the chimney (trapped between the platform above, ground below, walls around). It helps to do architecture in a level with dialogue so you can just type 'play 0' and be teleported back to where the dialogue happens.

> Bug: Angles are messed up. Anything between 30 and 60 degrees actually produces a 30 degree inclination. This repeats itself every 90°, I think.

> Small detail: to check that you're right in the middle of two things (ex: edges of a platform), you can jump, look straight down, and check that said two things appear on each border of your screen at the same time as you go up.

----- Some Framerate Issues -----

Objects of type "chimney", "tunnel", "weird", and "cool" are bad. Intersections are bad. Rabbits/wolves are very bad. The most you can see at the same time, the worst (so characters far away from each other are not so bad.) Fires are also very bad.

> Warning: objects of type "cool" cripple the FPS when they're newly born, but not as much once you reload.

> Feature: making the clipping plane closer (ex: 'viewdistance 0.8') can allow much higher FPS and salvage the level (toggle skybox off, lower fadestart, and pretend it's fog).

================ CHARACTERS ================

> Feature: you can use 'clothes' with the name of any PNG file in the Data/Textures folder (without the '.png'). Some of the names listed in the DebugReadme are wrong, and some are missing, notably Gi. Just check your Data/Textures folder. You can add anything to that folder and still use the 'clothes' command with it.

> Feature: You can color the skin of anyone the same way as a cloth. Type 'noclothes' followed by 'tint [whatever color]' and then 'clothes all' ('all' is just a random string that is not the name of a PNG file in the Textures folder).

> Small warning: Characters don't follow their assigned paths very precisely. They do unnecessary weird moves if the path is a little close to any object.

> Small detail: The main character can begin any level with both a sheathed knife/sword and a staff (but not enemies, as far as I know).

> Speaking of which: It's quickest to arm and spinecrush an enemy to get a weapon. It's also the fastest way to move them, since you can throw the corpse.

================ DIALOGUES ================

----- Basics -----

As far as I know, the dialogue-editing feature of the map editor always crashes. Several people have tried. However, you can just open any map from the regular campaign, and change what the characters say. You may also:
> Overwrite camera views with one another, and permute them.
> Change the position (top or bottom of screen), color, and sound associated with a string.
> Change the level, of course, including the look of the characters, with the map editor.

However, when a dialogue starts, every character that partakes in it, including you, is teleported to a fixed location.

Below is the address of dialogue-related information, counted from the start of any dialogue string you can find in the map file. All numbers are in hex.

Code: Select all

 -17: 00 00
 
 -15: 01 = dialogue on top of screen 02 = on bottom.
 
 -14: Color.
     For copy-paste purposes, the usual colors are :
     3D CC CC CD 3D CC CC CD 3D CC CC CD = grey
     00 00 00 00 00 00 00 00 00 00 00 00 = black
     3E 4C CC CD 3D CC CC CD 3D CC CC CD = semi red
     3E 4C CC CD 00 00 00 00 00 00 00 00 = red
     3D CC CC CD 3E 4C CC CD 3D CC CC CD = semi green
     00 00 00 00 3E 4C CC CD 00 00 00 00 = green
     3D CC CC CD 3D CC CC CD 3E 4C CC CD = semi blue
 
 - 5: Sound. Quoth David:
     "I think 1-2 are chitter sounds, 3-4 are pain, 5-8 are attack, or
     something along those lines."
     Here's a kind of guide:
     0- Silence
     1- chit-chat, mounting-descending
     2- Very similar to above
     3- Scroosh, plain and short
     4- Screech! pain!
     5- truhu, short chatter
     6- Creetsh, attack!
     7- aha, short banter
     8- Scroosh, short, affirmative tone
     9- Wolf growl
     D- Wolf casual bark
     F- Wolf bark
     10- Wolf chit-chat bark
 
 -1: Dialogue string length. Remember to adjust it.
  0: Dialogue string (starting at the first letter. # = blank character,
     ignored. Insert a line-break every 30+ -in hex- characters. Both 0A
     and 0D work as line breaks).
  
 After end of dialogue string:
     00 00 00
     then [length of speaker name string, including the space]
     20 (space)
     [speaker name string, #=blank, skipped]
     44 ('D')
 
 From there, the next 94 characters contain the view info (camera angle,
     character head direction, etc...). They can be replaced with one
     another, and thus swapped/overwritten/etc.
----- Bugs and Tricks -----

> Feature: There's a trick to make a dialogue that doesn't work work again, provided you have a reasonably recent, working backup. (The backup can be older than that needed for the all-around level fix presented earlier.)
I'm talking about a dialogue that's not triggered anymore after you modified the map with the map editor.

First, check that you saved the map with hostile set to 0. Most dialogues won't work otherwise. If the dialogue should start immediatly, also check that your character is at the right place (usually, near the person he's supposed to talk to). If the dialogue still doesn't work, go on.

Open your hex editor, and copy-paste the bytes from address 2F to 41 from the backup to the current level. Among other things, this sets the main character to the right place.

Check: the number before the 'B' character on the very first line of the file is the same as in the backup, probably a 0.

Either everything crashes (backup is too old), or the dialogue works again.

> Feature: aka the many ways of dealing (or not) with the bug that slightly changes the height map every time you load the game. It completely messes up the camera angles, that do not depend on the ground level.

-Tactic 1: Don't change the terrain type, and use maps where heightmap works. You're left with a pretty narrow choice.

-Tactic 2: Use maps where the dialogue occurs above ground level. They are the best.

-Tactic 3: Create a rock or such below the character and have him sit on it. He won't be dependant on ground level. However, make sure that the character is teleported above the relevant object when the dialogue starts. More often than not the ground can still get higher than the object. It can help to make the character immobile. He won't be teleported. Speaking of which-

> Feature: The immobile command prevents a character from being teleported at the beginning of a dialogue, so you can move him with respect to the camera angle.

> Feature: When using Rocky Hall maps, you may of course use camera angles from any of them. Plus there's no heightmap issue because you're above ground level.

> Small detail: if you want the main character not to appear in the dialogue (ex if you want everyone seated), you can use the last maps from the regular campaign where dialogues between the guards are triggered from the throne.

================ The Campaign File ================

It's very simple. Format:

Code: Select all

 Campaign Levels: 31
 
 Level 1:
 Name: svenroad
 Description: Giant_Ruins_-_start_new_campaign!
 ChooseNext: 0
 NumNext: 1
 NextLevel: 2
 LocationX: 197
 LocationY: 370
> For ChooseNext:
0 = Immediately load next level at the end of this one
1 = Go back to the world map
2 = Don't bring up the Fiery loading screen. Maybe other things, I've not investigated. Damn, I should've used this in the Snowy Fields levels.
> For NumNext = 1
I've tried creating branching points in the story line. It just doesn't work properly. The story branches but then the levels are not the right ones. Ignore this unless you can get it to work.
> For LocationX and LocationY
It's the number of pixels from top left of Data/Textures/World.png.
In OS X, you can open the world map in GraphicConverter and activate the position display ("Window" menu) to easily check coordinates as you move the mouse on the map.

Post Reply