A Utopia At Stake Created 2 months ago2019-01-16 00:46:21 UTC by Admer456 Admer456

Created 2 months ago2019-01-16 00:46:21 UTC by Admer456 Admer456

Posted 2 months ago2019-01-16 00:46:21 UTC Post #341687
Before I introduce the mod, let's have a little bit of history.
3-4 years ago, I started working on my first Half-Life mod. It was originally called Admer: The Game.

It actually started out as a QBasic text game. I had QBasic classes in 7th grade, and I'd finish my tasks so quickly I'd get enough time to work on a game. It was simple. You spawn in a cave, and for some reason there's a zombie in front of you. I'll write about that one in a journal.

I had an idea to make a single-player Half-Life map pack based on my text adventure. I downloaded some textures from the Internet (stock photos, lol), and I just threw them into Wally after downscaling them. The results were this:
User posted image
User posted image
There was some dynamite at the end of the cave in the text game, so I thought I'd add it. The dynamite would explode and make a hole in the cave ceiling, so the player could exit.
User posted image
Soon after that, the player would encounter a small hut, with a pistol and a piece of paper. It's not important what's written on the paper.

As you can see, it looked kind of terrible. If you want, you can check out the mod on ModDB: https://www.moddb.com/mods/admerthegame
I once renamed it to An Unknown Game, because I understood that it was bad to call a mod by yourself. :P (in fact, I was the protagonist in the mod, lol)
The mod was supposed to get released somewhen in 2017. Clearly, it would never get to that point.

I gave up on it in Q3 2016. My programming skills sucked. I didn't know my way around the Half-Life SDK, and my mapping skills were definitely bad, as well as the rest of my skill set (except video editing, my only skill that wasn't under average).
I was lazy. All my ideas were in my head, I was too lazy to write them down and I had no mod design document, no organisation, no anything. I simply didn't know where I was going and what to do, so I half-baked everything. (ahem, quarter-baked)
I had some wacky ideas there and there, e.g. a programmable universe where people spawned things via code (scrapped, won't fit the story of AUAS). That mod is, in fact, the very origin of Jody. (you all remember her, lol)

I've occasionally visited the mod's page on ModDB in the past 2 years. I remembered the old stats, suddenly. It used to have 10s, sometimes 100s of viewers per day, and now it varies between 0 and 1. So I thought "How great would it be to do this again, except with the skills I have now?"
The time wasn't then, however,

I was analysing some progress of my skills. Since 2015, I've improved in mapping a lot, in texturing a lot, video editing significantly (I mean, not much to be improved since I've been video-editing since the age of 8), sound editing a lot, music production so-so, but there was just that one skill that stagnated. That one skill which prevented me from reviving my old mod.

It was programming. In late 2017, I started panicking due to the fact that I knew I'd have programming class the following year. So I wanted to prepare myself.
(little did I know, they hardly teach you anything here in high school when it comes to programming)

I just needed a good start. Something to jump-start my learning. And in November 2017, a guy from the 2nd or 3rd year came into our classroom, recording a promo video for the high school. We were having IT class, and our professor told us to open Dev-C++ and pretend to be typing something. They all pretended. Except me.

I opened up a source file, saw how it's written, memorised the syntax and commands within a minute, and wrote a program. When I returned home, I got VS 2010 Express, registered it and decided to make GMan vulnerable.
It was an unbelievable experience for me back then. I actually understood something for once. And all he was doing was setting his health to 50% of his max health every time he was attacked:
Now that was just the beginning. I called my little brother in and showed him that, and he was so amazed. He laughed in disbelief, because all the time he knew about HL (since the age of 2 or 3), he knew that you just can't kill GMan. Not in my mod. ;)
But then, there was a period of stagnation. I hadn't really touched Visual Studio any more. Instead, I observed. I listened to Shepard's and Solokiller's programming lessons on the TWHL Discord (lol), I've read numerous coding stories from other developers on Quora, and so on. So essentially, I did the same as I did with mapping. First read a bunch of tutorials and documentation, and then try working on it.

In late 2018, however, I got into C++ again after a long period of not doing coding. I got my new PC in July, and that meant I could finally get my hands on Visual Studio 2017, a nice step up from Visual Studio 6.0, 2005 Express, 2009 Express and 2010 Express.
My 2007 laptop simply didn't have enough space for 2012, 2015 nor 2017.

And that meant a new beginning, a new age. I was looking for some libraries that can enable me drawing stuff to a window, and boy I found one: SDL. I learnt quite some C++ for those few months, and coming back to the Half-Life SDK once again, I finally understood most of the stuff in it. It felt amazing to finally understand something that troubled you for a few years. That age was the age of learning something I've always wanted to learn.

I had prototyped a function in AngelScript for Sven Co-op (it was my first time tinkering with AS scripting), and then I decided to implement it in the HL SDK.
It led to the creation of this mod. I'll be working on the technical part for a long time. Once it's done, I'll move onto the actual mod revival itself.

So, what is this thread about?

A Utopia At Stake

Will you save it?

There's a world out there. A world where everything is close to perfect. You move because of education, a future brighter here than on Earth, and for the fun of it. Things will look perfect, until a series of events lead to the downfall...
Its fate... is up to you.

Well, I'll just post stuff here about the mod.

Here's a summary of what I've made in the last couple of months:
  • semi-auto for the pistol
  • env_viewsway, an entity that messes up the player's view angles, useful for drunk effects, rocking ships etc.; is capable of inducing nausea (seriously)
  • trigger_valueop, my personal favourite, as it can change any keyvalue of an entity which it targets, it's very powerful
  • trigger_difficulty, which triggers something depending on the skill level, which can be easy-hard but also not easy, not medium and not hard.
  • util_rotator, something that spins an entity around an axis, but it's not in a very good state at the moment (it rotates things, but eh... I feel like it should use quaternions rather than regular angles)
  • util_consoleprinter, a very useful debugging entity when you're developing an entity setup or a scripted sequence series
  • a customisable HUD with about 15 parameters, most of them being for the TDTR effect (The Deader The Redder - the lower your HP, the redder the health display)
  • vehicle_base, a really, REALLY basic vehicle. It's a chair that you can enter and exit. But the system itself is quite flexible under the hood, allowing for multiple vehicle types, whether it's cars, planes, space ships, boats, or chairs & sofas (why not). I'll describe them more in my next post
  • additions to the CBaseEntity class which allow trigger_valueop to work
  • additions to the input and client commands, which allow for sprinting (and being able to control the vehicles in a more special way) - and best of all, it doesn't need more bandwidth than 1 to 2 bytes/sec per player ;) (keep in mind that an empty map with one player is already about 27 to 50 KB/s, assuming the netgraph displays it in kilobytes/second, I could be wrong) (thanks to Solokiller for the information about pev->button)
  • new view sway, viewmodel bob, you name it (thanks to Shepard for helping me with the old HL WON rotational bob, it's 1 line, but 1 important line)
Suggest me a name for this mod, because it can still be changed. For now I'm just calling it AdmerMod 2018, and the source code AdmSrc (which has no relations to Source, it's just a short way of saying "Admer's source code").

Oh right. One last thing before the next post. I'm hoping release this mod's source code when it gets to Beta or Release Candidate, maybe even earlier. It's based on Solokiller's fork of the HL SDK, that is compatible with VS 2017. I've already sent versions of the source before the "VehicleAPI" and "ControlAPI" were written, because some people simply asked for it. :)
Admer456 Admer456Lean, mean, mapping machine :3
Posted 2 months ago2019-01-16 22:06:01 UTC Post #341705
"I'll describe them more in my next post"
So, the vehicle system is approximately like this:

A vehicle can consist of 4 types of components. Bodies, engines, seats and wheels.
Bodies and wheels are physical components meaning they're visible and you can collide with them. Engines and wheels are, on the other hand, logical components, meaning they just contain some info.

Bodies have a model, and physical info like mass, position etc. Similar thing applies to wheels.
vec3_t pos; // from the VehicleBody type
float Mass;
float Density;
string_t m_iszModel;
Seats serve as pointers to players, and they listen to commands from the player they point at. There are 4 types of seats: driver, gunner, passenger, and driver-gunner. It's pretty self-explanatory what they do, i.e. driver seats are the only ones allowed to control the vehicle, gunner seats may control the vehicle's guns, passenger seats do pretty much nothing, and driver-gunner seats combine driver and gunner seats.
VehicleSeatType type;
vec3_t pos;
CBasePlayer *pSessilis; // Never thought you'd see Latin in the HL SDK, did ya?
bool fExists;
int iSitdex; // Cool name for a seat index ;)
Engines contain info like health, gear ratios, number of gears, drive type (currently only 4: FWD, RWD, AWD and NWD a.k.a. NoWD, which is reserved for flying vehicles and other wheel-less vehicles) etc.
int              HorsePower;
float            MaxHealth;
float            GearRatios[9]; // Maximum of 7 gears + 1st neutral 0th reverse
int              Gears;
float            Efficiency;
VehicleDrive     Drive;
To test some things, I made a chair. A simple chair that consists of a body and a seat. The body is actually a brush model, but it could've also been a Studio model. It's the bounding box that really matters. Either way, this chair handles player interaction and even a very, very, very primitive movement system where the chair slides on the floor.
User posted image
User posted image
User posted image
User posted image
User posted image
User posted image
It's a beginning. :)
Admer456 Admer456Lean, mean, mapping machine :3
Posted 2 months ago2019-01-17 19:52:45 UTC Post #341709
You're making a promising coding base for your mod. It will be interesting to see any mapping progress too.
Posted 2 months ago2019-01-17 22:57:55 UTC Post #341710
I'm glad to hear that. Especially when it's coming from you.

And you probably know why:
The only true comment for 'Admer The Game'The only true comment for 'Admer The Game'
To think that this was 4 years ago, man, it's amazing how time flies. :D

There will be mapping screenshots and stuff like that. But only test maps for now, until I finish most of the code base.
Of course, it doesn't mean that these dev maps won't be pretty. :)

My vehicle test map has got some quad terrain, and doubtlessly, so will the next few vehicle test maps. One will have a flat race track, so no terrain there, but, one will be a "4 quadrants" map having a desert, snow, jungle and rocky area, one will be completely designed for water vehicles (and air vehicles) etc.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 1 month ago2019-01-21 20:01:39 UTC Post #341768
Well, I can be a bit abrupt sometimes, but I'm always happy to see that people can learn on their mistakes to make something better. And you definitely made some progress.
Posted 1 month ago2019-01-21 22:21:24 UTC Post #341775
"Well, I can be a bit abrupt sometimes"
Oh no, I didn't mean to imply anything like that, I'm just saying that your comment back then was 100% right. Especially the 1st sentence.

Anyway, after mostly improving the chair vehicle (which will probably appear as an Easter egg in the final mod), I've recorded some of it:
DevVideo 2: a vehicle!
However, since it's the 21st of January, that means that my winter break is over. :(
I won't work on this mod base very often during the next 3 to 4 months, but I'll still get a little bit of time to work on it during the weekends. :)
I'll likely leave the vehicle system for now, because there are a couple of entities I have to clean up and polish.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 1 month ago2019-01-22 15:10:02 UTC Post #341784
Well, I can be a bit abrupt sometimes
Yes :crowbar: , but you help people a lot. That´s what counts in the end. ;)
Posted 1 month ago2019-01-23 00:15:59 UTC Post #341790
Yeah. That's what's important.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 1 week ago2019-03-11 21:03:00 UTC Post #342217
After a month of silence, it's time for some news. :3
  • The FMOD implementation is so-so. It loads the library, starts the system, creates and loads a sound, but fails to play it.
User posted image
User posted image
Yeah. But I think I know the cause. I'll get to it later on.
  • The Vehicle API has been enhanced, and simplified so I can make it easier for myself, and for others, to actually code the vehicles.
In the VehicleThink() function, you can now just place these two:
User posted image
...instead of manually and individually setting the origin of the player, the seats, setting the angles etc.
Basically, you have to set positions for each seat, then for the player, then the angles, listen to the commands from the player, and perhaps other things in the near future. Now you just need to call 3 functions or so, as opposed to writing 5-6 lines per seat (now imagine having a minibus vehicle with 16 seats - blimey!).

Support for studio model vehicles has been added, so now I can finally have vehicles with bones, controllers and whatnot. It was just sitting there and all I needed to do was precache and switch the model, if the mapper assigns a "model" keyvalue. It looks pretty neat:
User posted image
Currently this is just me debugging the seat position stuff. With the chair, it was really easy because you'd just snap the player to the centre of the chair, but now you gotta add a bit of trigonometry and vector maths. :P

Being based on the chair code, it behaves exactly like the chair: https://i.imgur.com/b5Bxqrn.mp4

Now, what's next?
  • A seat-switching algorithm (you can switch to another seat e.g. from the driver to the passenger seat if it's not taken by a player)
  • Motor/engine stuff, like switching gears according to the RPM. (manual transmission one day? Who knows)
  • Binding seats to bones, and utilising controllers for special vehicles (studio model only stuff - brush-based vehicles will use my maths xd)
  • Potentially a way of scripting vehicles in text files. Stuff like engine horsepower, gears, the model and whatnot. This way, it will not be hardcoded, nor "hardmapped" (even tho' you can ripent a map etc.), and it will still remain serverside. :D
  • More complex vehicles: aircraft, boats, and ultimately... cars and... maybe if I become mad enough, NPC vehicles
  • Eventually, NPCs that can drive vehicles. That would be insane, don't you agree?
Before I move on to that, I'll have to polish the current set of features and fix bugs (there's gotta be some!). I still have to code taking damage, exploding, switching the engine on and off, emitting sounds... Basically the smaller things. :)
Admer456 Admer456Lean, mean, mapping machine :3
Posted 1 week ago2019-03-12 19:36:44 UTC Post #342235
What a reason to implement FMOD? You can just use Half-Life method of triggering soundtracks. FMOD is a stupid crutch, IMHO. The only reason to use it, is because it can add fading effect to tracks. But the bad part is that you must implement it, and your game code will depend on specific external library, and music will play even if you go to menu (and even if you minimize the game, AFAIR). You can use normal MP3-tracks, just replace Half-Life's ones. You can also stop a current track by triggering empty track (0).
Posted 1 week ago2019-03-12 21:33:43 UTC Post #342237
100% because I can. :)

But seriously, AFAIK FMOD supports MIDI music, so something like that would be amazing, because then you can save a lot on space. :D
And then there's OGG support.
and music will play even if you go to menu (and even if you minimize the game, AFAIR)
Sounds and music can be paused though, can't they? As for minimising the game... pretty sure there's a solution to that too, even if it's a bit ugly coding wise. :)
Admer456 Admer456Lean, mean, mapping machine :3
Posted 1 week ago2019-03-13 06:47:06 UTC Post #342249
FMOD does support MIDI out of the box on Windows. On other OSes lile Linux, you will likely need a soundfont first.

It's possible to detect if the game window has focus with SDL2 (assuming you are using GitHub SDK), I need to find the code again but it is possible.
Shepard62700FR Shepard62700FRHalf-Cat is watching...
Posted 1 week ago2019-03-13 10:35:30 UTC Post #342250
The engine has a limit to the number of mp3 files it can play. It internally assigns an id to each one and there are a maximum of 200, which includes the files in /media. FMOD doesn't have that limit.
Posted 1 week ago2019-03-13 17:47:25 UTC Post #342253
It's possible to detect if the game window has focus with SDL2
Yesss, that's exactly what I was thinking about!
On other OSes lile Linux, you will likely need a soundfont first.
GASP I almost forgot.
I gotta try compiling my mod's code for Linux one day. It's gonna be one hell of a ride IMO. :P
Admer456 Admer456Lean, mean, mapping machine :3
You must be logged in to post a response.