News | Forum | People | FAQ | Links | Search | Register | Log in
Mapping Help
This is the place to ask about mapping problems, techniques, and bug fixing, and pretty much anything else you want to do in the level editor.

For questions about coding, check out the Coding Help thread: https://www.celephais.net/board/view_thread.php?id=60097
First | Previous | Next | Last
Arrgh 
I lost a really long, nicely formatted post about the various systems that govern ai decisions, then the computer crashed. Here we go again:

It's quite hard to follow how the various functions that govern the decisions the monsters make. The functions involved for any given monster are spread out over 3 qc files, so here's a summary of how a monster goes from running to attacking. It starts in the running animation frame functions, which call ai_run().

ai_run(float dist) (ai.qc)
The first thing this function does is check if the current enemy is dead, and find another target if so. Once satisfied with the enemy, the function checks self.attack_state. If it is set to AS_MISSILE the function runs ai_run_missile, and if it is AI_MELEE it runs ai_run_melee. Otherwise the function runs CheckAnyAttack to see if the monster should attack yet, and if that returns false the monster runs forward the distance specified by dist.

CheckAnyAttack() (ai.qc)
This function asks the question "is this a good moment for the monster to start attacking the player?". If it is not then the function returns FALSE. If it is, then the function returns TRUE, but also starts off the attack sequence, in a way that varies from monster to monster. If you look at the function you will find lots of lines like:

if (self.classname == "monster_shambler")
return ShamCheckAttack ();

So it's actually another function that determines whether an attack occurs. If a monster is not on this list then it uses CheckAttack to decide.

CheckAttack (fight.qc)
This generic function checks if the player is in line of sight, and then if they are in melee range executes self.th_melee. If the monster does not melee attack, then there is a chance it will enact a missile attack from self.th_missile. The exact probability of an attack depends on the range. Otherwise the function returns FALSE, so the monster will go all the way back to ai_run and run forwards.

ShamCheckAttack() (fight.qc)
It's interesting to note that ShamCheckAttack has a slightly different approach to CheckAttack. Although the decision process of whether to attack or not is similar, if it decides to missile attack, it just sets self.attack_state = AS_MISSILE. Then the next time the monster runs ai_run(probably the time of it's nextthink), it will run ai_run_missile.

ai_run_missile() (ai.qc)
This calls self.th_missile only if the monster is facing the player, making it slightly different to the CheckAttack method.


So at the moment the Gnerk is using CheckAttack, and so leaps at the player before it is facing the right way(DemonCheckAttack uses the AS_MISSILE method). The first thing to change would be to add a line
if (self.classname == "monster_gnerk")
return GnerkCheckAttack ();

to the function CheckAnyAttack. That way you use the GnerkCheckAttack function you added. You have to prototype it before CheckAnyAttack.

There are a number of ways you could add the lightning attack. One would be to add lines like

chance = random();
if(chance < 0.1)
{
gnerk_magic1();
return TRUE;
}

just after the lines

if (enemy_range == RANGE_FAR)
return FALSE;

of GnerkCheckAttack. This directly calls the attack. The problem is that it misses out on the AS_MISSILE bit, so the gnerk will attack before it's facing the player. Another way to do it would be to set

self.th_missile = Gnerk_ChooseAttack;

in the monsters spawn function. Then write a function Gnerk_ChooseAttack which randomly selects either gnerk_jump1() or gnerk_magic1(). You could even make it select the attack based on effectiveness, but that would be contrary to the tradition and style of Quake... 
Oh... My Odds And Maths 
My god, Preach, if I had the knowledge you had I probably made my own Quake mod of Hellboy. I'm only joking of course, although the idea won't leave me alone. But this little creature took already 825 verticemeshes of my time, so.. let's get on with it.

First let me thank you for your thouroughly explination of the source code. I'm beginning to understand it has more to do with comparisions than with logical copying. And me maths are a wreckage, but right.

I'm glad someone took the time to make an odd fool like me to understand how things work and I'm really gratefull for that. This qc can't stand a wrong aphostrophe and that hurts.
I hope it wasn't my code that crashed your computer.

As far I can understand I tried your first attempt on the GnerkCheck Attack, and I hope it was in the fight.qc and not in the ia.qc(?)
Changing the line gave me a few errors as the compiler doesn't want the gnerk_magic1. I have reposted the fight.qc so you can see.

It has gone deep in the night as I rearranged new gnerk sounds from the hellboy dvd, and my nerves started rumbling the same.
But the change from Gnerk_jumpTouch to Demon_GnerkTouch was a good hint! So far things run great, even in fastqcc. Hope my language also... 
More Prototyping 
You also need to prototype gnerk_magic1 before you use it in GnerkCheckAttack. Once you do that it should work fine. The usual thing to do when you get that error is check whether the function is defined before or after in the code. If it's defined after then you need to prototype(or move the order of the functions around, but not a good idea when they start in different files). If it's supposed to be defined before, then check for a typo - remember function names are case sensitive too! 
Great Preach! 
Good Old Quake has got an new monster coming!!!
Tricerops Tribolites combines demonfiend attack with shammy's lightning bold.

Fox must have been mad to make this attempt, but succeeded and becomes madfox again! 
Please Help Me 
So my problem is HexenII related, but I thought that is a general problem too.
The first is that I need years to vis my map (several hours on my celeron 700)
The next thing is that the water is not vised. Usually it is vised on default. (=now it looks like quake1 with r_novis 0 and r_wateralpha <0)
So I checked the log-files of the compiling tools and have only one error in the bsp.log: "r_cutnode new portal was clipped away"
Does anybody How do I fix that? 
HexenII 
I know nothing about, but if:

- it was a Q1 map
- fullvis was slow
- by "not vised" water you mean transparent

then I'd say thet you've a leak that the compiler isn't telling you about, a very common error in old build tools.

If the map format is reasonably similar to Q1, you might be able to try one of my qbsps, just to see if it finds a leak.

Otherwise it's probably time to pull out the old leak hunting tricks, e.g. put big solid blocks over parts of the map and rebuild until you've nailed the leak. 
Thanks Good Idea 
I guess the hexen bsp-format is very similar to quake1
I will try it 
I Got This 
TreeQBSP v2.04 -- Modified by Bengt Jardrup

Input file: ./maps/mymap127.map
Output file: ./maps/mymap127.bsp
---- LoadMapFile ----
*** ERROR 03: Line 17: Invalid brush plane format

Elapsed time : 0:00

Peak memory used : 1.4 MB

!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!!-!
Build failed, because it did not create the (+BSP) file: C:\appl\spiele\hexenII\
UhexenII\tmpQuArK\.\maps\mymap127.BSP
Build failed, because it did not create the (+PRT) file: C:\appl\spiele\hexenII\
UhexenII\tmpQuArK\.\maps\mymap127.PRT 
Or If 
my qbsps can't read the format, you may be able to export the map from the editor (e.g. QuArK) to Q1 format and then rebuild.

Or if you can find more recent tools that can build HexenII bsps, maybe they'll work better.

You can also verify that your map leaks by noclipping outside, if you can see the textured outside of the map, it leaks in hull 0. 
The Error Message 
indicates that the brush face format is incompatible with Q1. Since I see you're using QuArK, try exporting the map to Q1 format if possible.

If you can't proceed, send me the zipped map and I'll see if I can figure out what's going on. I don't have HexenII though, so I can't check it out in-game, but I've QuArK. 
No It Does Not Leak 
I can't see the textures outside the map.

Maybe it has something to do with:

a) It's a big outdoor map
b) It's the map I started mapping so almost everything is off grid 
More Than Likely 
Its the grid; It's a bastard to fix as well because the errors can be all over the place.

I'd advise adopting a preferred grid size in future for all walls / floors and sticking to it, only going smaller for details or different mapping techniques - curves, terrain etc.

I don't know QuArK much but I'm assuming theres a vertex manipulator - that'll allow you to snap everything to grid, although it'll be a gruelling task.

Another option would be to cut out a piece of the map and copy paste it into a new file, correct it and make sure its not leaking and then c+p the next section until you've got all the important features. Fairly primitive way of doing it but you'll be sure to have a very clean mapfile. 
You Can Check 
the mymap127.prt file, again if it's similar to Q1 then there are two numbers on the first two lines of the file. The first is #leafs and the 2nd is #portals.

If they're high (>10000), then you've probably too much solid detail and need to simplify or turn into func_walls or similar.

Having a messy outdoor map is a good start to a major vis headache ... 
I Guess I Have Got To 
tidy up the mess end compile it later and also with other tools. Apart from the off grid there are a lot of microbrushes too
(There is a lt of work to do)
I might ask later if that does not fix the problem

Thanks a lot for advice :) 
Trigger_relay Sounds 
How to avoid trigger_relay to emit a sound ? I have 4 choices in QuArK (i.e 0: none, 1: secret, 2:beep beep, 3: large switch). I selected the "none" option, but I still have a "beep beep" like sound ingame... Is it the normal behaviour, or am I missing something ? 
 
Don't put anything in the "message" field. Right? 
Not Sure 
But 0 should work - different editor. Maybe try editing the .map direct with notepad.

Another question, similar;

How do I stop a door_secret playing its touch sound after it's opened? Using in the case of ones that remain open.

If all else fails I can just embed it in a wall recess or clip brushes. 
Trigger_relay Sounds 
I checked the .map file, and the sound filed is set to "0"... pretty weird.. any idea where it could come from ? 
Does It Have A Message Field? 
 
Neg|ke 
Yes, it has a message field... is it the cause of the "issue" ? 
Neg|ke 
Oh, and one of them doesn't have, but the beep beep sound is here BTW 
Triggers Beep 
when they have a message field, unless it's completely empty ("" no space).
If yours also beep without, check the trigger/button firing them. 
Neg|ke 
OK, I have a single trigger_realy that causes the issue: it is generating a beep while triggering a sound, and it is not really the effect I wanted... I have this one to check particularly: thanks for the info ;)

BTW, as I already launched a fullvis run, is it possible to hack the BSP to remove the message field, or is it mandatory that I recompile all the stuff from scratch in order to obtain the wanted effect ? 
JPL 
Set the trigger's sound field to an invalid value then, like 4.

You can easily recompile the map with -onlyents if you only edited entity flags. Remember to run light -onlyents too if there are switchable light styles in the map. 
Neg|ke 
I'll try it... and even if it doesn't "work" as I want, I can launch again my fullvis, as it was running only since 12 hours... so not a big waste of time...
Anyway, thanks ! 
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.