News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - argoon

#31
id Tech 4 Engine Coding / working with idStrg class
August 27, 2017, 04:32:26 PM
Hello guys and gals :)

I need help from some idtech 4 coder that has experience working with the idStrg class, it has many functions ( or members )  to mess around with, but because i don't know what half of them do i'm really going blind here, what i'm trying to do is take a file path, like a icon path, get a particular string from it (like a file name) compared that to some other string and if true or false run some code. Anyone here know anything about this? 
#32
id Tech 4 Scripting / Re: getButtons
August 27, 2017, 04:14:57 PM
Yes to return impulses you just replicate the buttons code.

First you need to make a way for the script engine to read them by creating a script event


const idEventDef EV_Player_GetImpulses( "getImpulses", NULL, 'd' ); // "getImpulses" is the func name of your script event, NULL just tells we don't pass anything to the func, 'd' means we return a integer

EVENT( EV_Player_GetImpulses, idPlayer::Event_GetImpulses)

/*
==================
idPlayer::Event_GetImpulses
==================
*/
void idPlayer::Event_GetImpulses(void) {
idThread::ReturnInt(usercmd.impulse);
}



Then you create a script func on the doom_events.script file or your own file (you need to call your file on the doom_main.script for it to work).

scriptEvent    float   getImpulses();

To test the func and know what impulses you have active in what keys you can do the following:

call that on the player script

eachFrame
{
float impulse;

impulse = self.getImpulses();

sys.println("You used Impulse: " + impulse );
}








#33
id Tech 4 Scripting / Re: getButtons
August 27, 2017, 09:38:59 AM
You should always include a sys.waitframe() or sys.wait(somenumber) in all loops or they will cause a loop error, btw there's a helper function included in Doom 3 called:


eachFrame{ some code }


Behind the scenes is in reality a while loop with a sys.waitframe already included.

Also all functions with a loop, meant to run for a long time, when called on init() or main() should use the thread keyword before the name, like so -  thread funcName();
This is so your loop runs on a different thread and lets other game code run at the same time, if not it can "clog the pipeline" and make stuff slow. 
#34
id Tech 4 Scripting / Re: getButtons
August 26, 2017, 02:36:17 PM
Quote from: bitterman on August 26, 2017, 12:22:23 PM
But how to work with getButtons in script?

I need to do this: when key is pressed then some script function is running.

Now I try to realize it with level script, start thread func from main () & check into thred func some buttons via getButtons. But when I try to do this in while (1) it's causing an loop error.

How to listen key events?

Thanks.

Like i said before normal key usage in idtech 4 script is very limited, there's only a few keys available and there's no way in vanilla idtech 4 to get impulses by script (i changed all that for my version of fhdoom engine tho).

But here is how (before i was coding on the engine c++) i managed key/buttons events for scripts.



//Custom help function made by me to manage buttons - this was on a separate script file.
float giveButtons(float userbuttons, string buttonType)
{
float result;

/*
btn0 = 1 & userbuttons; // Attack
btn1 = 2 & userbuttons; // Run
btn2 = 4 & userbuttons; // Zoom
btn3 = 8 & userbuttons; // Scores only for MP
btn4 = 16 & userbuttons; // Mouse look
btn5 = 32 & userbuttons; // Button 5
btn6 = 64 & userbuttons; // Button 6
btn7 = 128 & userbuttons; // Button 7
*/

if (buttonType == "btn0")
{
result = 1 & userbuttons;
}
else if (buttonType == "btn1")
{
result = 2 & userbuttons;
}
else if (buttonType == "btn2")
{
result = 4 & userbuttons;
}
else if (buttonType == "btn3")
{
result = 8 & userbuttons;
}
else if (buttonType == "btn4")
{
result = 16 & userbuttons;
}
else if (buttonType == "btn5")
{
result = 32 & userbuttons;
}
else if (buttonType == "btn6")
{
result = 64 & userbuttons;
}
else if (buttonType == "btn7")
{
result = 128 & userbuttons;
}

return result;
}

// Code i used on the player script

#define USE_BTN  giveButtons(buttons, "btn0")

float buttons;


buttons = $player1.getButtons();


if ( USE_BTN ){
   entity.callFunction("someFunctionName");
}



That code above was inspired by the following documentation on modWiki.


Quote from: The Happy Friar on August 26, 2017, 02:04:34 PM
If you want a specific key then bind that key to the command you want to run.  It can run any console command, including script functions.

IE
bind h "trigger scriptfunction"

Pretty sure "trigger" will activate a script function.

Hum i didn't knew about that! If it indeed work then it indicates that by using that trick you can use more than the 7 buttons (three really some are hardcoded in the c++ code) that the player getbuttons() func provides. :)

But now that i think about it, how does this trick knows what function in what script file i'm talking about? I assume i have to include the full path to the script file not only the function name? Because if i only need to include the name then that tells me that function needs to be uniquely named and that imo is a serious limitation, i'm wrong?
#35
Strutt your stuff! / Re: fhDOOM (modernized idTech4)
August 23, 2017, 06:09:48 PM
Quote from: grml4d on August 23, 2017, 12:47:46 PM
the files were made 10 years ago ...so updating jpg , curl & ogg will only be a good idea..
i searched and then looked at the files...the libraries should be very easy to replace...same goes with zlib and bfg edition .
the sound system for me is as important as updating opengl to vulkan or even more... O0 O:-)
playing in stereo is not as great as 5.1 or 7.1 ...  :-\

You only think stereo is bad because HRTF is not used in most games, ;)  also Doom 3 and idtech4 is capable of 5.1 and 7.1 sound from the beginning.
#36
Strutt your stuff! / Re: fhDOOM (modernized idTech4)
August 21, 2017, 08:45:14 PM
Thanks eXistence, happy that you found time and motivation to work on your engine! :)

Will try to merge with the version i have, i did some deep changes to it but they are only on the game side of the engine, hope all goes well, because your fixes do sound like they will come on handy.

Btw sorry about the shader stuff was never able to do the test map that you wanted, but no problem i also decided to not mess with shaders for the time being.


edit: Don't know if is a placebo but i played doom 3 with your new engine version and i most say it runs fantastically, soft shadows and all, smooth 60+ fps's on a AMD R9 270X at 1080p.
#37
Thanks for the files, but they are not need, they are just simple .txt files, it was shader testing code and so idSoftware removed them because the engine doesn't really use .txt (extension) for anything, it uses .vp/.vfp files for shaders or .cg files in the case of BFG edition, also many warnings on the console are really harmless. :)
#38
id Tech 4 Textures / Re: Another Material Question
August 15, 2017, 11:24:18 PM
Quote from: spamclark15 on August 15, 2017, 11:03:42 PM
What part of the editor should I use?

open the game console and type:

r_showSurfaceInfo

This console command will show the material name of the surface directly under the crosshair, unfortunately it will also detect invisible materials, so you need to move around until it shows a material name that makes sense.
#39
Quote from: spamclark15 on August 14, 2017, 09:00:52 PM
I meant of places that still exist. I remember sites that actually had lots of DOOM 3 stuff but they're gone.

Don't know if you are aware of this site, it was dead but got recently brought to life.

http://www.gamefront.com/games/doom-iii/downloads#downloadsbrowse
#40
Quote from: The Happy Friar on August 11, 2017, 09:24:12 PM
Because it's not a news site.   :stroggflag:
Just announced today.  It's friday, people work.  :)
Q3A apparently has one in the works too.

Article doesn't have much info, but a relevant question is that with this rendering performance enhancement, can Doom 3 BFG now do large open areas with lots of polys and AI moving around + lighting w/o slowing to a crawl?

I'd imagine motorsep is compiling this moment to check.  :)

;D yes but i do work, i just forgot time diference  :D.

I don't think a Vulkan render will help much with that, it will enable more stuff but i don't think big forests will be one of them, but i could be mistaken.

Btw,  of topic, do your perchance know what peace of engine code controls the mouse icon for the full screen guis and the action button? Normally is the Mouse 1 key that triggers actions on GUI's but after i appropriated it for another use, clicking on GUI's stop, unless i assigned the attack button to another key, i tried to follow where the attack button is called but i don't seem to see anything obviously controlling GUI's interactions.
#41
id Tech 4 Discussion / why is this not news here!?
August 11, 2017, 03:57:43 PM
At lest i don't see any thread about it...  :P

Doom 3 BFG got a Vulkan render! written by a id Software coder, so in a sense a official render!

http://www.phoronix.com/scan.php?page=news_item&px=Vulkan-Doom3-Available

#42
Are you running the new BFG version of Doom 3? I'm asking because Vanilla Doom 3 should run on your GPU if you disable some things and enable the path for old GPU's, people were able to make Doom 3 run on older 2002 GPU's like the Geforce 4 and the Radeon 9200, and if you disable shadows and normal maps even older GPU's, it will look like garbage tho.

So unless your Intel GPU is worse than a ancient Dx7 GPU, that i find really unlikely, has bad has Intel GPU's are they aren't that bad, i blame your GPU drivers, try to update them and see if that solves the problem.

By the fact that Elite force that is a idtech 3 (Quake 3 engine) game runs, proves that your GPU is on par with dx7/dx8;

So you should be able to make Doom 3 run, it will not look good and play that fast but will run, ok try this, make a autoexec.cfg file on the base folder of Doom 3

Put this on there:


seta r_shadows "0"
seta r_skipBump "1"
seta r_skipSpecular "1"
seta image_ignoreHighQuality "1"
seta image_usePrecompressedTextures "1"
seta image_useCompression "1"
seta image_anisotropy "0"
seta com_machineSpec "1"
seta r_multiSamples "0"
seta r_render "R200"


start the game, good luck.

You can also go to this TDM link (it uses more or less the same engine as Doom 3) and see what they recommend there for old computers.

http://forums.thedarkmod.com/topic/18670-performance-tweaks-for-low-end-pcs/

Some of the options are only for the TDM version of the engine but you should be able to detect which. 

#43
id Tech 4 Scripting / Re: Quake 1 grenade physics
August 08, 2017, 10:27:21 AM
Quote from: Cyber8 on August 07, 2017, 08:11:41 PM
Hi, the D3 handgrenades have really bizarre physics, bouncing and jittering on the floor like it was made of rubber.
I want to achieve the physics from Q1, so only things I'd like to know are, how collision model looks for Q1 grenades, and what do those mean?
entityDef projectile_grenade {
"spawnclass" "idProjectile"
"mins" "-3 -3 0"
"maxs" "3 3 11"
"cylinder" "6"

I know it has something to do with collisions for the projectile but I can't figure out what those numbers do.

I'm not sure but i think mins and maxs are the size of the object bounding box, and i'm pretty sure cylinder is the physics primitive shape for collisions.

About the physics, the Doom 3 hand grenades, they use the idtech 4 physics engine and if you see how other objects bounce around you will see they are very similar in behavior, is just the physics engine that idSoftware uses, is very simplistic, to try to improve the grenade behavior you could mess with the physics properties defined in the entityDef file, like mass, bounciness, etc, but don't expect much of it, unless someone replaces the physics engine (i'm sure will never happen) the physics are what they are.

Btw while playing the new Doom i realize the object's physics were suspiciously similar to those of Doom 3, so perhaps they still use the old idtech 4 physics engine even on idtech 6, i was under the impression they replaced their physics engine for the Havok physics engine but i'm not sure anymore.
#44
Quote from: Snehk on August 04, 2017, 02:39:59 PM
Haven't done too much due to lack of time. Noticed that GUI Editor crashes on start-up every time I try to launch it. I'm using Windows 10, maybe it has some problems with that? Another issue: Particles editor loads properly, but it's window is too big. It's not resizeable and there are no sliders to get down to other options. Is the resolution hard-coded or does it scale up to screen resolution?

I scripted in func_static by checking engine code and original Doom 3 scripts. It loads models properly, I tried with an .ase model (.lwo are a bit of a pain to load). I'm also working on an animated model, already tried exporting a test md5 from Blender and it worked.

I don't know if Motorsep messed with the original idtech 4 tools but they do have some requirements to work well, some are, disable antialising (r_multiSamples 0), run on a window, etc.

For example this is how i open the gui editor using a .bat file and it works (I use the fhDoom engine).

QuotefhDOOM.exe +set r_fullscreen 0 +set fs_game mygame +set r_multiSamples 0  +set r_gamma 1 +set r_mode 6 +set vid_restart +editguis

+set fs_game mygame is optional if you don't know, this is used only if your game data is not run from the original base folder.

btw to easily test a gui, without the Quake 4 gui editor, do the following:

make a .bat file and put this on it:

QuotefhDOOM.exe +set r_fullscreen 0 +set fs_game doombra +set r_multiSamples 0  +set r_gamma 1 +set r_mode 6 +set vid_restart +testgui /guis/guiname.gui

Then use on the console:

reloadGuis // this to see gui file changes almost in real time

gui_debug 1 // To see a red frame around all the GUI objects.

Btw this red frames should show on the quake 4 gui editor as well, but for some reason they don't show for me, if that happens to you, you can use the "border" windowDef option to use a custom frame around the object making it easily visible.

Also the gui editor works (minus the red frames) for me on W10, it is crash prone so save often, some times it crash's because you have a syntax error on your gui file (unfortunately shows no good error message when it crashes) other times it will show a total black window, mostly because you have some assets missing or also some syntax error, afaik there's no easy way to debbug gui files but the code is not that complex and the engine console do show some obvious gui errors.

I have used other idtech 4 tools before, like the particle editor, AF(ragdool) editor, the material editor, etc, all of them have their problems and quirks, you just need to find what they are and work around them.

(unless BFG is different) Before you spend days looking (like i did) onNamedEvent's are not able to be called by the script system only by the c++ code, and to call a custom gui file from a script you need to explicitly call it from a entity with "gui" key "guis/guiname.gui" value.


About models:

I mostly use lwo for static models imo is a much superior format because is binary (so is faster to load but BFG already transforms all formats to binary so is not that important to you), another reason i also use it, is, you don't need to edit it by hand to make materials work, like you sometimes need with .ase models, if i'm recalling well is also the format id used the most for Doom 3 (after MD5 for animations) and lastly afaik Blender (i personally use Modo) supports .lwo you just need to enable it on the preferences.

Good luck :).     



#45
id Tech 4 Discussion / Re: Fantastic BFG VR mod!
July 31, 2017, 11:33:52 AM
Quote from: motorsep on July 31, 2017, 12:50:14 AM
Quote from: argoon on July 30, 2017, 08:09:32 PM
Can someone explain to me how were they able to modify the BFG flash GUI's so deeply without the source files?

It's all in C++ code. Flash is just art, placeholders so to speak. Everything is driven by C++.

Quote from: spamclark15 on July 31, 2017, 01:37:33 AM
Flash is actually very easily decompiled. The previous poster is also correct as the logic driving all the Flash stuff is actually C++.

Hum, ok thanks, it seams i need to study more the BFG engine and see how it is done.