Jump to content
The Dark Mod Forums

Dragofer

Development Role
  • Posts

    2634
  • Joined

  • Last visited

  • Days Won

    157

Posts posted by Dragofer

  1. 1 hour ago, Geep said:

    This is off-topic regarding prefabs, but is there an expectation that future FMs use mapx instead of map? What's the earliest version of TDM that will solidly support mapx?

    Mapx is colloquially known as "portable map format". I think DR-wise nothing speaks against them becoming the default format, but Im not sure whether TDM supports them (fully).

    • Like 1
  2. 1 hour ago, STRUNK said:

    I saw someone made a bunch of different colored firefly stuff already but I haven't found an AI for it. Is someone working on such a thing already?

    Those are simply animated invisible models with a particle bound to them - no AI involved there. It's quite an efficient way  to make such ambient creatures if they don't need to travel too randomly.  They can also go on quite long paths this way.

  3. 4 minutes ago, STRUNK said:

    I also set up a trigger timer targeting a target callScriptFunction with "call" "batDeath" .. but it prints in the console that batDeath does not exist ..

    This wont work because batDeath isnt a global script function, but part of a scriptobject. You can look at the security camera "4-button" prefabs to see how to call object functions on an entity with a callObjectFunction entity.

    • Thanks 1
  4. 10 minutes ago, Araneidae said:

    @Dragofer, I expect you're right.  Not sure what to do with my reports then, it's a bit tricky to reproduce.  It seems to happen when the alert stimulus is very brief, I either bump up against a guard or am briefly glimpsed; I guess there's then a disconnect between the guard's own alert status and the global alert status.  Last time I tested this I checked with `tdm_ai_showalert 1` and indeed the guard was on high alert, and the global status was zero.

    Already sounds useful - have you opened a ticket on bugs.thedarkmod.com for this? Thats the best place to keep such information.

  5. 3 hours ago, Araneidae said:

    By the way, I'm still seeing major alerts not showing up in the display provided by tdm_loot_stealth_stats.pk4. 

    It's most likely a longstanding bug that's only coincidentally been revealed by the stealth score addon. Normally the beta phase in the dev cycle is reserved for fixing features that were added or changed for that version, unless it's something small. Fixing the stealth score bug seems like it could be a real project, and grayman would have been the one best suited to do it given his great familiarity with the AI code.

  6. 1 hour ago, stgatilov said:

    I profile with frontend acceleration most of the time, and Tracy shows stuff properly.
    Here is one such example.

    Ok, it's normalised now - will have to see whether I run into that bug again at some point. Btw, these are the instructions I wrote out for myself and the other people involved in the FM:

    You can get the Tracy app from this page: https://github.com/wolfpld/tracy/releases/tag/v0.7.8
    The link is at the bottom of the page under Assets: Tracy-0.7.8.7z
    - Extract that 7z somewhere and open Tracy.exe
    - Start TDM, enter "com_enableTracing 1" into the console and then load the mission.
    - Switch to the Tracy app and click on "Connect", then after a few seconds click on "Stop".
    - In the top left, click on the Wifi symbol, then on "Save trace" to save it on your PC. Just leave the compression settings at default, so LZ4.
    - Upload the .trace file to i.e. Google Drive so we can analyse what your PC spends its time on in TDM.

     

    • Like 1
  7. 31 minutes ago, STRUNK said:

    I tried "burnaway"  "0" and  "burnaway" "1" with no result. I think Bats might just burn away in green flames, but I don't know how to do that yet.

    You can set a "death_script" spawnarg on the bats so a script is called when a bat dies. The cleanest way would be to make a small scriptobjection extension that inherits from the bats' existing scriptobject and only contains a script function that's called by that spawnarg - see Scriptobjects section of the A to Z Scripting guide for how to set that up.

    • Thanks 1
  8. I've been running the Tracy profiler earlier today to analyse some performance issues with a contest WIP (do we have a Wiki article for that? Only found something old by Tels) and noticed that it produces almost no output if Frontend Acceleration is enabled under experimental video settings - the file size is also only 1% as large as with that setting disabled.

    • Like 1
  9. 3 hours ago, STRUNK said:

    but I'm still wondering what fly_seek_scale actually does?

    I've glanced in the code earlier today - "seek" seems to have to do with predicting where the AI will be in x seconds based on current position and velocity. I'd assume if you set a high value it'll look far ahead and change course long before it would fly into an obstacle.

    3 hours ago, STRUNK said:

    That said, if your "animal_patrol_wait" could be added to 2.10, animal_patrol bats can be an option for mappers.
    Bats don't like small spaces anyway, only to sleep in; these bats don't sleep. (fly_seek_scale works good enough?)

    We're really far advanced in the 2.10 cycle, but something like this seems quite minimally invasive, especially since the code would continue to use old default values unless the AI has that new spawnarg. More complicated stuff like zDelta would be too risky, so would have to use existing methods for vertical movement.

    3 hours ago, STRUNK said:

    Making the bats not damageable  is a good solution to not deal with ragdolls and such.

    A ragdoll is basically a string of collision meshes bound to the joints of an AI. Could try out the AF Editor for giving the bat 3 simple collision meshes around its body + wings.

  10. 32 minutes ago, STRUNK said:

    animal_patrol_wait as a boolian probably, and get rid of your original animal_patrol_wait

    animal_patrol_wait can already be used like a boolean - if you set it to 0 the bats will never wait, if you set it to 1 the bats will wait 1s which happens to be the default. Imo turning it into a boolean would be a step backwards that deprives mappers of the ability to set different waiting times.

    Also, I would change the flow of the code as little as possible. It's likely better to go into the wait state and use a wait time of 0 so that there's no or minimal delay. In TDM code, waiting usually works by checking the clock to see if the current time is now equal to or larger than (start time + wait time), so if wait time is 0 that's immediately satisified.

    39 minutes ago, STRUNK said:

    The "states" where the bat is in most of the time is:

    Did you also see what state the bats are in when they are frozen?

  11. I think you need to add some debug messages to the code to help figure out which state the bats are in when they freeze. Can add this line into each of the states, substituting the dots for the name of the state:

    gameLocal.Printf( "currently in state: .... \n" );

    Would be a useful clue for figuring out where the code goes wrong.

    This debugging works best if you only have 1 bat in your map.

    • Thanks 1
  12. 2 hours ago, STRUNK said:

    I changed some things though:
     

    // Choose a goal position, somewhere near ourselves
    float xDelta = gameLocal.random.RandomFloat()*wanderRadius - wanderRadius*0.5f;
    float yDelta = gameLocal.random.RandomFloat()*wanderRadius - wanderRadius*0.5f;
    float zDelta = owner->spawnArgs.GetBool("animal_patrol_fly", "0") ? gameLocal.random.RandomFloat()*wanderRadius - wanderRadius*1 : 1;	

    That's weird, I read your change to zDelta's calculation as resulting in it being anywhere between 0 to -240 in Z from the bat's starting position - whereas previously it was -120 to +120. Definitely good to hear it does work for you, though.

    Btw if you change variables that are shared between functions you also have to update the .h file - only attached the .map and .cpp here. Would also make sense to attach your version of the .def file.

    2 hours ago, STRUNK said:

    I got the newest SVN, but its newer than the latest available update via th installer, but it seems not to matter in this case.

    I actually meant the TortoiseSVN client - it has a checkbox during installation to include the revision number.

  13. On 1/18/2022 at 3:36 PM, STRUNK said:

    Thanks a lot! I'm gonna try if I can compile it and make it work locally, then I can try to tweek it.

    Update: I managed to compile with your experimental build and it works. Only thing I got a warning " Cannot detect SVN version " in the console, but I guess it has to do with the latest source I got with the turtoiseSVN (and having the latest available update of 2.10 installed (via the TDM installer) and those are not the same.
    Nontheless, the animal_patrol_fly works so things are looking good. Tomorrow morning I'll go do some fiddling around : ) (Yes I have a fresh install for this so I can't f*ck-up my working game).
     

    Nice - but I assume you still have a high bob_strength? When I set that to 0 or 1 the bats still stay completely horizontal, so the addition of zDelta isn't having any effect unfortunately.

    For the SVN version, you need to make sure you've installed TortoiseSVN with one of the options selected as mentioned in the wiki article. But it's stopped working for me - or maybe it just never worked on this particular PC.

  14. I've made a rough experimental build that implements some new spawnargs, shown below with default values (if the entity doesn't have these spawnargs the code will fall back to these default values):

    "wander_radius_horizontal"	"240"
    "wander_radius_vertical"	"240"
    "animal_patrol_fly"		"0"
    "animal_patrol_wait"		"1"

    Added a zDelta based on wander_radius_vertical but it doesn't seem to have any effect:

    wanderRadiusH = owner->spawnArgs.GetFloat("wander_radius_horizontal", "240");
    wanderRadiusV = owner->spawnArgs.GetFloat("wander_radius_vertical", "240");
    ...
    // Choose a goal position, somewhere near ourselves
    float xDelta = gameLocal.random.RandomFloat()*wanderRadiusH - wanderRadiusH*0.5f;
    float yDelta = gameLocal.random.RandomFloat()*wanderRadiusH - wanderRadiusH*0.5f;
    float zDelta = owner->spawnArgs.GetBool("animal_patrol_fly", "0") ? gameLocal.random.RandomFloat()*wanderRadiusV - wanderRadiusV * 0.5f : 1;
    
    idVec3 newPos = curPos + idVec3(xDelta, yDelta, zDelta); // grayman #2356 - was '5'; reduced to keep goal positions from becoming too high for rats

    The spawnarg for waiting, however, does work as intended.

    Anyway, you can use these modified files to make the build for yourself using this compilation guide from the TDM wiki. Compiling a build is very quick (1 button) once you've got it setup.

    AnimalPatrolTask.hAnimalPatrolTask.cpp

    • Thanks 1
  15. 9 hours ago, Acolytesix said:

    Luckily I copied everything Thief to a whole other HDD, so no foul on the 2.09 version. That still works on that drive.

    You're beta can't be played on the 2.09 at all?

    No, already the presence of the new security camera entities - which rely on code and script that only exists in 2.10 - would stop TDM from even starting with this FM selected.

    @WellingtoncrabWould be good to add this line to the bottom of your darkmod.txt - it tells people they have a too old version if they try to play this FM pre-2.10:

    Required TDM Version: 2.10
    • Thanks 1
  16. 1 hour ago, STRUNK said:

    Because of the "fly_bob_vert" I put in probably?

    Okay, looking at the def it becomes clear:

    	"fly_bob_strength"		"500" 	// "How far flying creatures should bob"
    	"fly_bob_vert"			"1"	// "Rate at which flying creatures bob up and down."
    	"fly_bob_horz"			"0" 	// "Rate at which flying creatures bob left and right"

    bob strength 500 means it adds up to 500 to the bat's current vertical velocity ( rotated by the bat's axis ) - so that explains why the bob is far too strong. If I set it to 1 the bats stay completely horizontal.

  17. 1 hour ago, STRUNK said:

    I think the function(s) to randomly pause movement must be defined in a script that dictates " animal_patol".

    Bats don't pause so somewhere pieces of the  "animal patrol" script should be eliminated to accopmlice that?

    "Animal patrol" is 100% implemented in C++ - you can look at it yourself here: AnimalPatrolTask.hAnimalPatrolTask.cpp

    The pause duration is set here - would be quite straightforward to replace those hardcoded 1000 milliseconds with a variable derived from a spawnarg so you can disable it completely if you want (would cause zig-zag flying, probably fine for bats):

    case stateWaiting:
    	if (owner->m_bCanDrown && owner->MouthIsUnderwater()) // grayman #2356 - don't hang around if you're drowning
    	{
    		_waitEndTime = gameLocal.time;
    	}
    	else
    	{
    		_waitEndTime = gameLocal.time + gameLocal.random.RandomInt(1000);
    	}
    	break;

    If they hover too often, it's because their speed is too high in comparison to their allowed move radius. Maybe you'd want to force a certain minimum movement distance, or set a chance for the bat to keep moving without waiting.

    This is how the animal patrollers choose a new destination to move to:

    case stateMovingToNextSpot:
    {
    	const idVec3& curPos = owner->GetPhysics()->GetOrigin();
    	_moveEndTime = 0;
    	for (int i = 0 ; i < 5 ; i++) // grayman #2356 - try a few positions to increase movement in small spaces 
    	{
    		// Choose a goal position, somewhere near ourselves
    		float xDelta = gameLocal.random.RandomFloat()*WANDER_RADIUS - WANDER_RADIUS*0.5f;
    		float yDelta = gameLocal.random.RandomFloat()*WANDER_RADIUS - WANDER_RADIUS*0.5f;
    
    		idVec3 newPos = curPos + idVec3(xDelta, yDelta, 1); // grayman #2356 - was '5'; reduced to keep goal positions from becoming too high for rats
    		if (owner->MoveToPosition(newPos))
    		{
    			// Run with a 20% chance
    			owner->AI_RUN = (gameLocal.random.RandomFloat() < 0.2f);
    			_moveEndTime = gameLocal.time + 10000;	// grayman #2356 - 10s timeout on getting to your next position.
    													// This keeps you from getting stuck trying to reach a valid goal
    													// that's unreachable. I.e. the goal is on a ledge and the rat
    													// trying to reach it falls off the ledge.
    			break;
    		}
    	}
    }
    		break;

    Notice how it only calculates x and y, but sets z to 1. No idea at the moment what even causes bats to fly vertically during animal patrol.

    idVec3 newPos = curPos + idVec3(xDelta, yDelta, 1); // grayman #2356 - was '5'; reduced to keep goal positions from becoming too high for rats

     

    • Thanks 1
  18. 7 hours ago, AluminumHaste said:

    Man, volumetrics can look so good in certain situations, though the effect might be too strong still with dust at 0.001

    Yeah, it'd be great if the volumetric dust property numbers were amplified to more natural values like a default of 1 instead of 0.002, then divide that internally by 500 if necessary.

    • Like 3
  19. 4 hours ago, STRUNK said:

    So that should be exported as an md5anim but with only 1 frame?
    I think Bats should not be killable by the way : )

    Yes, a single-frame animation. And the bats are already quite hard to kill, but I managed to do it after getting in a lucky shot with a fire arrow- despite all the spawnargs you had set. Would just permit it for those players who go through the trouble.

    Would upload the .def again for the other problems - or any problem with the bats.

    Regarding pauses during animal_patrol, I saw that there are hardcoded pauses between movements - maybe a new spawnarg can be added to make that optional. Will have to look more to see whether something can be done about the vertical flying.

    Btw, the hovering in place looks natural to me, just not the vertical flying.

    Regarding the scriptobject, it's in tdm_ai_base.script, try unpacking all your .pk4's. But I dont think the scriptobject or idle_animations are going to be of any help here.

  20. Another problem is that your af_pose animation is the same as the flying animation, which causes it to continue animating even when the bat has been shot down. It should be a single-frame default pose, like a T-pose for humans.

    By the way, this spawn code shows the default values assigned for the various "fly" spawnargs. If you comment out these spawnargs in the entityDef, the code will instead apply these default values:

    	spawnArgs.GetInt( "team",			"1",		team );
    	spawnArgs.GetInt( "rank",			"0",		rank );
    	spawnArgs.GetInt( "fly_offset",			"0",		fly_offset );
    	spawnArgs.GetFloat( "fly_speed",		"100",		fly_speed );
    	spawnArgs.GetFloat( "fly_bob_strength",		"50",		fly_bob_strength );
    	spawnArgs.GetFloat( "fly_bob_vert",		"2",		fly_bob_vert );
    	spawnArgs.GetFloat( "fly_bob_horz",		"2.7",		fly_bob_horz );
    	spawnArgs.GetFloat( "fly_seek_scale",		"4",		fly_seek_scale );
    	spawnArgs.GetFloat( "fly_roll_scale",		"90",		fly_roll_scale );
    	spawnArgs.GetFloat( "fly_roll_max",		"60",		fly_roll_max );
    	spawnArgs.GetFloat( "fly_pitch_scale",		"45",		fly_pitch_scale );
    	spawnArgs.GetFloat( "fly_pitch_max",		"30",		fly_pitch_max );

     

    • Thanks 1
  21. @STRUNKVery nice work so far! I've looked into the code and saw that this error message about AAS appears when the AI's bounding box is larger than the maximum bounding box size defined in the AAS type. AAS_elemental allows up to 24x24x24, so I changed "size" to "24 24 24" and commented out your "mins" and "maxs" spawnargs (they seem to be redundant, and elementals don't use these) and dmap now works properly, creating an .aas_elemental file.

    Some more remarks:

    • the .pk4 has one level of folders too many (the "bat" folder). You should create the zip archive while you're inside the "bat" folder, not by right-clicking it. This way you have the same folder structure as an FM .pk4 and others won't have to unpack it to play the test map.
    • It'd be much cleaner to let your small bat's modelDef and entityDef inherit from the large bat's defs using the "inherit" spawnarg. Then you can delete all properties except the ones that are different for the small bat, and any changes you make to the large bat will automatically be applied to the small bat.
    • Thanks 1
×
×
  • Create New...