Check out Half-Life Re-imagined competition results!
Check out Skewing textures in Hammer, our newest tutorial!
Welcome, torekk, our newest member!

logo

Site Stuff

Reference

Maps

Community

ShoutBOX

Poll

Feeling Blue

What's your favourite shade of blue?

Azure

13

Cobalt

30

Turquoise

8

Cyan

10

Royal

6

Teal

3

Onliners

13 mins

Jessie

20 mins

Bruce

47 mins

Dallas

1 hours

UrbaNebula

2 hours

Solokiller

2 hours

Stojke

2 hours

Archie

Affiliates

A gaming and technology blog by TWHL admins Penguinboy and Ant. A music blog by TWHL users Ant and Hugh.

Half-Life Enhanced

<< ... 3 4 5 6 7 [8]

Forums > HL Engine Discussion

01 Sep 17, 13:13
By JeffMOD
avatar
Call 141.12
Parenting would be really useful to have - That's one of the main reasons people still use Spirit of Half-Life despite it being so buggy. HL:Enhanced having it would be a huge selling point.
10 Sep 17, 07:16
By Solokiller
avatar
Member
I looked into this a bit more, i'll have to disable the engine's code in SV_Physics to stop it from wasting a bunch of CPU cycles and calling functions at the wrong time.

I can't do this using normal methods so i'll have to write a platform-specific hack to overwrite the return address passed to StartFrame so that it returns to wherever SV_Physics was called from.
This is assembly stuff so it'll be difficult, but it's not impossible.

Fortunately both SV_Physics and StartFrame are functions taking no parameters and returning nothing so it's pretty simple.

Something like this would probably do the trick:
Quote:

void* pReturnAddress;

__asm
{
mov pReturnAddress, [ebp + 16]
mov [ebp + 8], pReturnAddress
}


Where ebp + 16 is the location on the stack containing the return address for SV_Physics and ebp + 8 is the location for StartFrame's return address. The actual offsets will need to be determined for all platforms but once that's done it should be pretty straightforward.

For future reference:
https://stackoverflow.com/questions/1317316
2/how-to-replace-the-return-address-on-th
e-stack-using-a-buffer-overflow-attack

https://stackoverflow.com/questions/1263021
3/modify-return-address-on-stack

http://insecure.org/stf/smashstack.html

I'm going to ask Alfred if they can add in a callback for custom physics but i can tell you right now that's highly unlikely, but i can at least try.

Also, there has been talk of XML exploits using custom entities (not the kind you're probably thinking about) that allows for exploits, this can be disabled in Xerces-C: https://www.owasp.org/index.php/XML_Externa
l_Entity_(XXE)_Prevention_Cheat_Sheet#lib
xerces-c


So when this gets implemented in HLE this will need to be disabled.

While this is unlikely to cause problems in HLE due to mostly server side XML files, it could still happen if a malicious server downloads such a file to clients, who then run it locally and end up with crashes and instabilities.
20 Sep 17, 21:33
By Solokiller
avatar
Member
I've added some feature tracking stuff to the wiki: https://github.com/SamVanheer/HLEnhanced/wi
ki/Game-integration


Should make things easier for when this all gets added. If i've missed anything, feel free to add it or let me know about it.
21 Sep 17, 13:54
By Shepard62700FR
avatar
Member
Download Solokiller's Model and Sprite viewers for Windows x64 (built in September 21th 2017) @ MediaFire.

Also included with the binaries are "Kratisto's MDL decompiler from Milkshape 3D" and "DoomMusic's StudioMDL that fixes the UV shifting problem with textures and other stuff".

If you want a 32 bits version and/or another host than MediaFire, just let me know.
21 Sep 17, 19:06
By Solokiller
avatar
Member
Thanks for providing this smile - :)

I've written down a bare bones description for a new feature i've come up with to add some flexibility: https://github.com/SamVanheer/HLEnhanced/wi
ki/Filter-system


Basically identical to Source's filtering system, only a bit more powerful due to not locking you into checking activators only. There will also be an option to add your own filters through scripting, once that stuff is implemented.

You'll notice that i refer to inputs a few times, that's because i'm planning to implement an I/O system using Angelscript.
I won't be able to integrate it into the map file itself due to various issues (no map editor support, no .map/.rmf support, no compiler support), but it will be possible to add this using Angelscript.
It'll be a bit clunky but at least we'll have it available.

Regular trigger support will eventually be reworked into calling a default input like Source does where it calls into Use(), converting the parameter value into the appropriate use type (as in trigger_relay's "Trigger State" keyvalue, most other entities will use toggle).

I might add a way to specify outputs using the XMLized version of map configs, basically like using Source's AddOutput input in usage where you manually specify the options. That should be easy to use, though it could end up messy.

As with most features this would require source code access to fully implement in map files, unless a separate IDE were to be made and the data embedded into the BSP file or somehow paired up (mapname.io file perhaps), but the only way to make it simple is full integration into the map editor. There's also the issue of save/restoring filters, especially if using custom entities.

The ultimate purpose of this is to have control over game events like so:
Quote:

player->trigger_multiple{targetname=door_tr
igger}(Trigger)->filter_multi->[filter_ha
s_item(Test, item_keycard)->filter_item_property(Test, item_keycard, color, red)]->[func_door(Open), trigger_multiple{targetname=door_trigger}(K
ill)]


This probably makes little sense so i'll walk through it:
Quote:

player triggers trigger_multiple named door_trigger
trigger_multiple trigger filter_multi to check if the player has an item called item_keycard and if that keycard has a property "color" with the value of "red"
If both match, open the red door and remove the trigger_multiple


filter_has_item and filter_item_property could be custom entities here.
22 Sep 17, 13:17
By foxtrop
avatar
Member
any chance we get the fullbright rendering for the textures on the models?
22 Sep 17, 13:42
By Solokiller
avatar
Member
That's an engine level feature, i'd have to completely re-implement model rendering to add that.
23 Sep 17, 07:10
By tschumann
avatar
Member
Quote:
That's an engine level feature, i'd have to completely re-implement model rendering to add that.


Too bad - the client-side stuff seemed to provide a lot of flexibility with regards to model rendering.
23 Sep 17, 07:47
By Solokiller
avatar
Member
It ultimately calls into the engine to do the actual rendering, and the fullbright flag isn't checked there. There is code that checks r_fullbright, but nothing for the per-texture flag.
23 Sep 17, 16:28
By SourceSkyBoxer
avatar
Member
Hello @SoloKiller,

I ask about Half-Life Enhanced since I play it. Nice work! It works like Sven Coop. I am sorry. I don't want call again because you hate your hostile ex team.

1. Can I write angel script for env_model? If yes than I will try.
2. Can I write angel script for env_sky ( like sky_camera from Source Engine ) If not than I would like you have to add feature OpenGL into Angelscript?
Is it correct or wrong? Link Does it support for Half-Life with angel script? If no than.... How do they add reflection of water with MapInit() from angel script? I am sorry for bad English.
23 Sep 17, 17:49
By Solokiller
avatar
Member
What do you mean by env_model?

And no, you can't implement an env_sky for multiple reasons.

The first is that it requires client side scripting to do anything graphical, which is a pain in the ass to implement because it's missing callbacks. I may be able to hack it in using memory patching similar to how AMX mod hooks into stuff like cvar change events, assuming it doesn't trigger VAC. I'll have to ask Alfred about that, assuming he responds at all.

The second is that you can't override the engine's skybox rendering, so you'd have to handle rendering entirely in the client dll. As with everything in this engine that's a lot of work and possibly even illegal since replicating that code is against the EULA.

The code you linked is from a utility library that doesn't show how it's integrated into programs, if used in HLEnhanced you'd still need additional scripting API support to actually use it.

Even then it still depends on engine level code for things like supported features, since OpenGL context creation requires a version to be set first, and that's impossible to do from the client since that all happens before client code executes.
Though the linked code seems to be immediate mode only - which should always be supported - if you want it to run well you'll need shaders, which requires a newer OpenGL version than what is guaranteed to be provided.
The SDL documentation for this doesn't say which OpenGL version is used by default, so i'm assuming it uses whatever the OS chooses by default, which can be anything depending on your video card, drivers, OS, etc.

Reflection isn't easy to add either because that usually works by rendering the entire scene for the reflected plane, which while possible still requires the use of things like render-to-texture support to store off the reflection for rendering in the main scene. With all the above problems solved this one should be perfectly possible though.

Perhaps i should write a book's worth of reasons why we need the engine open sourced and send it to Valve, i'm getting tired of this turning into "spend half your life rewriting half the engine into Half-GoldSource while breaking half the copyright laws".
23 Sep 17, 17:56
By James Luke
avatar
Member
I mean, PARANOIA works with the latest Half-Life version, just with some tweaks, an no skyboxes due to the depth-range setting from the hacked .dll. Look at ARRANGEMENT, albeit it’s all hacky, it works just fine. Just cross-platform and legality stands in the way.

env_model was a newer feature from SOHL which is essentially Source’s prop_static. It’s probably the easiest from the list to implement.

I think he misunderstands how AngelScript works and what it’s limitations are.

Also, you can do whatever you want, or you can submit a pull request if you think what you add makes HLEnhanced better.
23 Sep 17, 20:05
By SourceSkyBoxer
avatar
Member
@Solokiller
env_model is like prop_static or cycle like @James Luke explained..
So sad, I can not make render like reflection into Angelscriptz, Do I understand correctly?

But PARANOIA 's env_sky looks bad like Cry of Fear - Since it happens common behind background if you move near to sky wall like Garry Mod's bugged sky_camera.


That is why I really don't like PARANOIA's source because it uses only glaux.h and is incompatibility to newest version my display card ( December 2016 , AMD Radeon RX 480 )

I didn't make criminal because I hold carefully.
24 Sep 17, 00:19
By James Luke
avatar
Member
Oy, SSB, do we have to go over this again?

Source =\= GoldSource. What about that do you not understand?

Reflection requires some pretty advanced OpenGL stuffs ON TOP OF a rewritten OpenGL renderer. Also, env_sky wasn’t terrible, it was much better than the SOHL one. But Garry’s Mod implementation of env_sky (or its respective name) is completely different except for its core principle.

Also, what’s with this glaux.h stuff again? It also used the standard includes, if you graphics card is newer than 2008, it should work, you just have to modify the code to not use the .dll. If it isn’t, get a new graphics card, it’s about time.
24 Sep 17, 07:08
By Solokiller
avatar
Member
Using a custom opengl32.dll for stuff like this isn't an option for at least 2 reasons.

1: the engine removes it if it exists.
2: VAC may ban you if you use it on a VAC secure server. This has happened to MSC players using a bloom mod in the past.

We need engine level support to do it safely.
24 Sep 17, 11:12
By SourceSkyBoxer
avatar
Member
Yeah you're right. I want safe too. You know that I never use criminal engine.
24 Sep 17, 16:29
By Solokiller
avatar
Member
https://www.reddit.com/r/programming/comme
nts/725bbw/an_indepth_explanation_of_how_
a_10_year_old_bug/?st=j7yy7b5y&sh=34a8e6c
d


Useful for anybody wanting to learn how to reverse engineer stuff.
25 Sep 17, 00:37
By James Luke
avatar
Member
That video was a trip.
<< ... 3 4 5 6 7 [8]

Forums > HL Engine Discussion

Login to Reply

You must be logged in to reply.