Forum posts

Posted 6 years ago2017-09-22 15:17:00 UTC
in Liquid Space Post #337472
The problem you have is that you keep biting off more than you can chew. We keep telling you to start with the basics, and every time you come back saying you'll start by making an engine, because you know some of the language's syntax.

I didn't get to the point where i can spot vulnerabilities like these until years after i started programming. I started small, failed at what i was doing, learned why i failed and how to do better and succeeded.

Based on your responses here you can't handle failure very well, and your response is to bite off more than you can chew again a few days later.

You really need to start with the basics. Even if that means learning how to write if statements again, it's how you start with learning any programming language.
If you want to make an engine you should start by looking at and using existing engines, preferably in the language that you're intending to make your own with.

Once you have a strong grasp of the syntax of the language and experience with one or more engines you'll have enough knowledge to start making an engine. You'll still fail at first, but you'll be able to learn from your mistakes, instead of just throwing your arms up and saying "i can't even understand words like what you are spewing out".

It'll take time, but if you really want to do this you'll get there eventually. How long it takes depends on how much time you spend on it, as well as how motivated you are and how much you already know.

If you have a problem you just can't fix you can always ask for help, and if it's too stressful you can take a step back and come back later. Giving up at the first sign of trouble won't get you anywhere.
Posted 6 years ago2017-09-22 14:28:59 UTC
in Liquid Space Post #337470
This code causes an access violation due to passing a garbage address into GetEntityName. pEntity isn't initialized to an actual object address.

More information: https://en.wikipedia.org/wiki/Uninitialized_variable

Even if it were, strcpy is unsafe so if the name exceeds 511 characters (or code points if we're talking UTF-8) it'll write past the buffer and over the stack, corrupting memory and possibly causing an access violation.

More information: https://en.wikipedia.org/wiki/Buffer_overflow

Even if the name were short enough, it's returning the address of a local variable, so anything that accesses it will be accessing memory that's been reused. printf will have local variables of its own, so that statement invokes undefined behavior.

More information: https://stackoverflow.com/questions/4643713/c-returning-reference-to-local-variable

If you can't spot these problems making a game engine will be difficult for you, even if you stick to existing safer and easier to use code. Engine development will always have a degree of low level functionality where things like this will pop up.

To take an example from the HL SDK: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/util.cpp#L404

A naive implementation would just return a pointer to an array of entities of MAX_EDICTS, which would work if it were a static local or a global variable, but then you have issues accessing multiple independent lists.

Passing in a pointer to an array and an array size is one way to handle this properly.

The only way you're going to make a game engine in C++ is if you have years of experience with the language. You'll have to put in the effort to learn it, be familiar with it, spot mistakes like these and others. You can only learn that by using it extensively, and you do that by starting with the basics.

Even if you know them from other languages, you should make sure you fully understand them in the context of C++.
Posted 6 years ago2017-09-22 13:33:42 UTC
in Liquid Space Post #337466
What does this code do:
[quote]
const char* GetEntityName( CBaseEntity* pEntity )
{
char szName[ 512 ];

strcpy( szName, pEntity->m_szName );

return szName;
}

void Foo()
{
CBaseEntity* pEntity;

printf( "Name: %s\n", GetEntityName( pEntity ) );
}
[/quote]

m_szName can be assumed to be a char* here.
This post was made on a thread that has been deleted.
This post was made on a thread that has been deleted.
This post was made on a thread that has been deleted.
Posted 6 years ago2017-09-19 12:05:36 UTC
in How do I stop npcs from persisting in ne Post #337443
Correct, if no transitions exist in the world then it will check if the entity can potentially be seen by the landmark, if so it will be moved over, up to 512 entities total.

There are some conditions that control it, but you should generally use transition volumes to control this.
Posted 6 years ago2017-09-17 11:31:44 UTC
in Liquid Space Post #337422
Based on what you're saying about OpenGL (everybody has it, because it's an API, not a thing to download separately), you are way out of your league.

A lot of people think they can make an entire engine from scratch and wind up failing miserably. You'll need years of experience before you can even think about doing that.

Start with the basics, make sure you have a good grasp of that first. You'll feel a lot better doing small stuff and succeeding at it than trying and failing to make an engine.

Trust me, you'll be pulling your hair out due to frustration if you try to make an engine now.
Posted 6 years ago2017-09-13 15:02:10 UTC
in Try Again Post #337399
You're trying to do too much at once, i didn't touch graphics stuff until 3-4 years after i started to code. Before that i used pre-built wrappers that did the work for me, i guess comparable to Unity or Unreal.
This post was made on a thread that has been deleted.
Posted 6 years ago2017-09-07 12:15:10 UTC
in Support different languages - how? Post #337344
This should be the complete list: https://partner.steamgames.com/doc/store/localization#supported_languages

The rest of the page has additional information about Steam localization.
Posted 6 years ago2017-09-07 10:36:36 UTC
in Support different languages - how? Post #337342
Posted 6 years ago2017-09-06 18:26:16 UTC
in no D3D on steam HL Post #337338
OpenGL performance depends on your driver support for immediate mode, if it's a crappy driver you'll have a slideshow.
Posted 6 years ago2017-09-05 09:23:11 UTC
in no D3D on steam HL Post #337297
The engine is set up to include renderers in its main library, so they would've needed 6 configurations on Windows (Software, D3D, OpenGL for Debug & Release, and possibly another set for No-Steam builds), and 2 for UNIX platforms (OpenGL Debug and Release).

Rewriting it to put the renderer in its own library would've taken a fair bit of effort and broken any hacks that rely on patching functions.

Rather than do all that they just threw out the only platform specific renderer instead, which reduces the number of configurations, gets rid of an OpenGL to D3D wrapper (which may have caused problems with the Steam Overlay at the time), and lets them optimize for OpenGL (as in write proper OpenGL code, not performant OpenGL code) on all platforms.
Posted 6 years ago2017-09-01 19:23:45 UTC
in Grunt Weapon Loadout Post #337219
To fix that just check if the grunt has the hand grenade, else always take cover:

[quote]
if ( !( FBitSet( pev->weapons, HGRUNT_HANDGRENADE ) ) || RANDOM_LONG(0,1) )
{
return &slGruntTakeCover[ 0 ];
}
else
{
return &slGruntGrenadeCover[ 0 ];
}

[/quote]

The second bug i don't know about, i can take a look at it.

EDIT:
It's probably just the animation and audio that keeps going, it won't actually shoot:
https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/hgrunt.cpp#L917
https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/hgrunt.cpp#L787

The real problem is the AI not changing schedules to stop the animation, but i'd have to try this out to see what it's doing to figure that out.
This post was made on a thread that has been deleted.
Posted 6 years ago2017-09-01 06:43:32 UTC
in Grunt Weapon Loadout Post #337206
I looked at the code, even if a grunt is set to 9mmar (1), if they are not in a squad the slGruntGrenadeCover schedule may be triggered, which has them dropping a grenade and trying to run for cover. In a confined space they will blow themselves up.

Try adding them all to a squad, see if that fixes it.
Posted 6 years ago2017-08-31 14:19:19 UTC
in Invisible texture bug Post #337190
You could try turning those angled parts into func_detail and just having flat brushes to block visibility.
Posted 6 years ago2017-08-31 12:28:01 UTC
in Invisible texture bug Post #337188
Could you show us what the map looks like in your level editor?
Posted 6 years ago2017-08-30 13:12:27 UTC
in valve backlash Post #337165
Maybe they'll finally tell us more than "we communicate through our products".
Posted 6 years ago2017-08-29 14:05:03 UTC
in How do .NOD files know they are up to da Post #337158
The checksums would need to be stored somewhere, and that's an issue, especially with custom maps.
Posted 6 years ago2017-08-28 06:20:51 UTC
in Disable a trigger_changelevel? Post #337128
The changelevel brush can be anywhere.
This post was made on a thread that has been deleted.
This post was made on a thread that has been deleted.
Posted 6 years ago2017-08-27 20:03:32 UTC
in Timer in HL1? Post #337110
TFC uses slow moving doors for their timers, but it also has additional keyvalues if i'm not mistaken.
Posted 6 years ago2017-08-27 17:52:42 UTC
in Disable a trigger_changelevel? Post #337105
trigger_multiple->trigger_changelevel with USE Only set, disable trigger_multiple master to disable changelevel.
I think that should work.
This post was made on a thread that has been deleted.
This post was made on a thread that has been deleted.
Posted 6 years ago2017-08-20 11:19:18 UTC
in I will Begin! Post #336947
You're going way too fast. Making a graphical program requires a good grasp of the basics, if you just jump straight in you'll be drowning in minutes.

I didn't start learning to use graphics APIs until over half a year after i started learning C++, and i learned it pretty fast, and then only using less complicated APIs, not the big stuff like OpenGL or DirectX.

If you really want to make a game i'd suggest learning to program well first, and then using an existing engine, unless you want to learn to make a game engine.
Posted 6 years ago2017-08-19 15:51:42 UTC
in I will Begin! Post #336938
Use an IDE like Visual Studio, Notepad++ is a terrible way to program stuff, especially for a beginner.
Posted 6 years ago2017-08-15 19:07:42 UTC
in Custom skybox not working? Post #336893
I've never used paint.net myself, but when i use GIMP to export as TGA i get the option to use RLE compression. Check if that's an option, otherwise you may have to use GIMP instead.
Posted 6 years ago2017-08-15 18:21:56 UTC
in Custom skybox not working? Post #336891
The TGA file needs to be either an "uncompressed true-color image (2)" or a "run-length encoded true-color image (10)". You'll need to make sure that they're saved with either encoding.
Posted 6 years ago2017-08-15 18:14:45 UTC
in Custom skybox not working? Post #336889
So I went the silly route and pasted the textures I wanted for the sky into MS Paint and saved them in HL/valve/gfx
They should be in gfx/env.
Posted 6 years ago2017-08-15 17:52:42 UTC
in Custom skybox not working? Post #336887
Check the console for errors, it should print something like "R_LoadSkys: Couldn't load icert.bmp" or "LoadTGA: Only type 2 and 10 targa RGB images supported" if it fails to load.
This post was made on a thread that has been deleted.
Posted 6 years ago2017-08-11 19:31:01 UTC
in help convert mp3 to HL wav Post #336852
Can't you just hex edit that or something?
Posted 6 years ago2017-08-07 17:49:47 UTC
in Half-Life Texture Error Post #336779
FBO and VBO are two different things.
This post was made on a thread that has been deleted.
This post was made on a thread that has been deleted.
This post was made on a thread that has been deleted.
This post was made on a thread that has been deleted.
Posted 6 years ago2017-08-04 10:21:54 UTC
in Shifting a whole map in hammer? Post #336702
It means how many degrees you can turn past the set pitch and yaw before it snaps back to that value. It affects AI turrets as well.
This post was made on a thread that has been deleted.
This post was made on a thread that has been deleted.
This post was made on a thread that has been deleted.
Posted 6 years ago2017-07-28 16:22:23 UTC
in Now Gaming: ... Post #336518
I once melted my old desktop's CPU thermal paste by playing San Andreas all day. Good thing i'd just bought a new one.
Posted 6 years ago2017-07-28 16:21:04 UTC
in TWHL Pockets Post #336517
Can the 1024³ cube be moved around, like a platform that confines the player's movement to it?
Posted 6 years ago2017-07-26 14:46:08 UTC
in Post your screenshots! WIP thread Post #336413
Yeah it avoids having to send messages to clients for it. Server side either you do it reliably and risk overflows, or you do it unreliably and have the effects cutting out when too much data is being sent. Client side your only limit is the maximum number of effects.
Posted 6 years ago2017-07-26 13:59:36 UTC
in Post your screenshots! WIP thread Post #336411
@Windawz depends on how you want to do it. Client side scripting would make it relatively easy, server side scripting could still cause overflows.
Posted 6 years ago2017-07-25 15:53:56 UTC
in TWHL Pockets Post #336361
Can the map be made with the premise that the same area is represented in different dimensions? In other words, multiple 1024³ rooms that are actually the same room?