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

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

Posted 7 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 7 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 7 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 7 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 6 months 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 6 months 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 6 months 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 6 months ago2019-01-23 00:15:59 UTC Post #341790
Yeah. That's what's important.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 5 months 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 5 months 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 5 months 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 5 months 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 5 months 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 5 months 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
Posted 4 months ago2019-04-01 20:25:09 UTC Post #342388

ADM v0.1 tech demo

Today I am releasing v0.1 of the mod base of Utopia At Stake, called ADM (Admer's DevMod). It has got the following features:
  • vehicle support
  • FMOD sound system implementation
  • Bullet physics engine implementation
  • bump-mapping (I never thought I'd reach this point)
User posted image
Download the tech demo right now:
ADM v0.1
Installs like any other HL mod, just extract the .zip into steamapps/common/Half-Life.
Should not work with pre-Steampipe versions, or rather anything lacking updated SDL2 and VGUI2 libraries. (sorry pirates and WON HL players)

The source code will be released some time later. :D
Have a good day/night, everyone.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 3 months ago2019-05-15 21:28:14 UTC Post #342625
Yeah, screw that last post. It was an April fools thingy.
Now back onto the serious stuff.

The CBaseVehicle class is siting at around 400 lines of code right now.
Since last time, I have added multi-seat support, seat switching, and better controls. But also, a very important change for modders who decide to use this tech one day.

And that is the following: creating new vehicle classes is super duper easy.
1. Define a vehicle class e.g. CVehicleVWGolf and base it off CBaseVehicle (however, it'll likely be CBaseCar, since each base is devoted to different vehicle types)
2. Define the VehicleInit() function
3. Let the base take care of the rest

And what did I do to make the two-seated couch work?
I just defined VehicleInit() like this:
m_iSeats = 2;

v_Seats[0].Init(Driver, v_Body.pos, 0);
v_Seats[1].Init(Passenger, v_Body.pos, 1);
Of course, this is just a part of the total function, but I'm planning to make it as easy as possible. For two reasons, really. Firstly, people would have to learn the whole vehicle system (and it can only get more complex in the following months), and that is not optimal for someone who just wants to create a vehicle. Secondly, I'm just too lazy to type 400 lines for each vehicle class, and you may agree that it's a bit inconvenient too. <w<

Either way, the new controls have arrived, finally. Up until now, my controls looked something like this:
if W -> push the vehicle in the direction the player's looking at
if A -> push the vehicle negatively in the X axis
if D -> push the vehicle positively in the X axis
if S -> push the vehicle negatively in the Y axis
That is, obviously, wrong (the ADS part) because those axes are world axes, not ones that are local to the vehicle.
So what I did was, I made it more standard, how you'd usually expect a car to be driven in games.
if W -> push the vehicle in the vehicle's front direction
if A -> rotate the vehicle's direction to the left
if D -> rotate the vehicle's direction to the right
if S -> push the vehicle in its back direction

All of this new stuff was programmed just today. Lastly, the seat switching. This one was the most tedious one, but it turns out I had a small inconsistency:
// Standard for all seats - always listen to unuse and seatswitch
fCommands[bi_unuse] = pSessilis->GetKeyButton(vehicle_unuse);
fCommands[bi_seatswitch] = pSessilis->GetKeyButton(vehicle_seatswitch);
This is what it's supposed to be like ^
However, I somehow placed the seatswitch listener into the Driver seat category, so only Driver and Driver-Gunner seats could switch. D:
But it was resolved in about 30 minutes.

Here are some videos:
https://i.imgur.com/5RWNHld.mp4
https://i.imgur.com/uRG4rmv.mp4
https://i.imgur.com/94xW83F.mp4

What's next?

Engines/motors. There's already some code, including the jokes:
void VehicleEngine::Damage(float hp)
{
    if (MadeInGermany)
        return; // engine was made in Germany, can't break
This is an actual part of the code and it'll stay that way. :)
Either way, the engines will be responsible for the vehicle performance. Think of RPM, gears, shifting and perhaps fuel if we want to be that realistic (though I don't really wanna add fuel). Either way, the engine will be damageable, and if it's broken, the vehicle cannot accelerate etc.

Wheels. Currently only the struct definition.
Wheels are interesting. They define the grip of the vehicle, and its handling. They will also be damageable, except the vehicle will still be able to operate after these are destroyed.

However, I will eventually create a new vehicle class to utilise all the 4 components: the body, the seats, the engine and the wheels.
A couch won't cut it. Once I get to the cars, then I can show the real power of the vehicle system. ;)
Admer456 Admer456Lean, mean, mapping machine :3
Posted 3 months ago2019-05-16 23:55:07 UTC Post #342628
I mentioned some seats there, but I haven't explained these in detail.
There are basically 4 types of seats: Driver, Driver-Gunner, Gunner and Passenger.
Driver -> vehicle accepts the driver-specific commands from this seat. Can turn on the vehicle's lights (if any), can toggle the motor etc.
Gunner -> controls the weapon component of the vehicle.
Driver-Gunner -> combination of both. Think of the HL2 jeep's tau cannon.
Passenger -> the simplest type. Does not control the vehicle, only sits there. Can only switch seats and/or exit the vehicle.

The weapon components are the next thing to be done, once the engine and wheel components are finished.
Tanks will require a weapon component, absolutely.
Now, Driver-Gunner seats and Gunner seats are the ones that can utilise these vehicle weapon components. Such a seat has to be linked to a weapon component, otherwise it'd be exactly the same as a passenger seat.

Another question might appear, and that is: are seated players able to use their own weapons? I'll let that be an option. If you want seat A to allow that, just flip the flag for that in the init function. :)
You'll likely want to disable the flag for driver seats, for example, and enable it for passenger seats. But this is something I'll definitely work much later on. For now it's a concept.

An example of a weapon component is a mounted MG on a Humvee. Even stuff like a mounted M60 on a helicopter. Either way, these will have to be attached to seat bones, for the sake of simplicity. This may or may not be the final decision for that, but we'll see. :)
Basically, seats assume that seat bones are the last seats of a model.
So you've got the following
Bone 0 - root
Bone 1 - something
Bone 2 - something else
Bone 3 - seat 1
Bone 4 - seat 2
But if we were to add more stuff, eeeh, it'd get complicated. They will likely use attachments then. We'll see. shrug
Admer456 Admer456Lean, mean, mapping machine :3
Posted 2 months ago2019-06-04 23:06:49 UTC Post #342693
I realised that I should perhaps write things down. My mod failed in 2015-2016 because I didn't write almost anything. Seriously.
So I am trying to do something about it.
User posted image
So, so much to write aboutSo, so much to write about
Later on, I'll have to write a list of core features, then the actual story, individual missions, short mod design document and then I got a plan to stick to. :)

My teammate made a significant addition, having thought of a new character, which will definitely make the mod's story more interesting. (and for the player to care about and become allies with ;) )

As for the vehicle system, I got a CBaseCar class now, with a different movement algorithm. I haven't yet tested it in-game, but it compiles fine. The vehicle engine is now more complete, with functions for acceleration, toggling etc., wheels now have a part of their own logic, and the vehicle manifests all that together.
The plan is to make a NEW test model because CBaseCar handles bones differently. It takes into account the root bone (that is bone 0), followed by potentially 4 wheel bones, so that's an offset of 5 bones. Therefore bones 5 and 6 will be driver and passenger, in this test model.
The model will actually be a bath tub, cuz' why not.
This is just the beginningThis is just the beginning
Admer456 Admer456Lean, mean, mapping machine :3
Posted 2 months ago2019-06-05 12:40:00 UTC Post #342697
I just read through all that.

You have so much enthusiasm, and you're willing to learn from your mistakes. Those attributes can take you far.

Keep going and keep learning. You still need more structure and planning before embarking on a project. Having a strategic plan will save you time and frustration.

You still have much to learn, young Padawan.
satchmo satchmoWhat you can do today should have been done yesterday.
Posted 2 months ago2019-06-05 13:19:44 UTC Post #342698
All of this is just preparation, I believe. This is why I'm writing everything down. I need priorities. Back in 2015, I only had a rough idea and I was making things up as I was going. That clearly led to nowhere with potentially large projects like that.
The year after, I started working on a Far Cry mod that would act as a 'sequel' to this one, that failed in 2015. That is where I discovered the concept of planning. :P

The few rules I came up with were to first write some documentation, then develop and implement features. Only then, once those two are done, I can do the actual content (that is most of the assets). This is the principle I'm working by, and it's the reason why a relatively smaller project like de_kobbl managed to succeed, and I even managed to pile together a whole game demo in 2 months, mostly from scratch.

The difference is, this time I'm focusing a lot more on the 1st part, the documentation. And that involves planning, alongside everything else (the descriptions, the story, the missions, the designs). And this time, I'm not alone, unlike before. :)

Thanks a lot for reading, and for what you said. I know I've got a long way to go.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 1 month ago2019-07-03 20:28:07 UTC Post #342833
Update time. :D

New features:
  • trigger_date, an entity that can only trigger something whether the actual date matches the entity's properties (e.g. you trigger something every Christmas)
  • trigger_date2, an entity like trigger_date, except for hours, minutes and seconds (3 AM horrors :D)
  • func_loadbar, an entity that moves in a direction, and loads from 0 to 100%, has 5 trigger-able percentage levels defined by the mapper (e.g. trigger a "Just a little more!" sound when it reaches 90%)
  • view bobbing + view camera overhaul
  • horizontal offset of the thirdperson camera
  • temporarily broke func_rotating
  • trigger_timer, triggers something periodically, can trigger randomly between a min and max interval as well
  • car prototype, with a working gearbox, needs steering implemented
  • actual physics test - it's possible now
  • new main menu UI colours :D
I like itI like it
Physics test
DevVideo 3
Admer456 Admer456Lean, mean, mapping machine :3
Posted 1 week ago2019-08-07 21:10:21 UTC Post #342970
Man, man, what a fool I was.
"The FMOD implementation is so-so. It loads the library, starts the system, creates and loads a sound, but fails to play it."
When I tried to do FMOD, I was doing it upside down.

I tried implementing it on the server side. XD
The sound entity would basically directly call FMOD's sound playing functions. Horrid. D:

It'd look something like this:
void CNewSound::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
    g_SoundSystem.PlaySound( m_sound );
}
// where m_sound is a member variable of this sound entity

// meanwhile PlaySound is defined as:
void CSoundSystem::PlaySound( FMOD::Sound *snd )
{
    result = system->playSound( snd, NULL, 0, NULL );
    ERRCHECK( result );

    result = system->update();
    ERRCHECK( result );
}
Something like that. Point is, this is entirely server side. :pwned:
Yes. I was an idiot. Laugh at me as much as you want.
Gonna quote Shepard on this one: "My god! What are you doing?"
Back then though, I didn't quite know how to do client messages yet. Now that I do, though, I might as well try it the proper way.

For now, I'm planning to do a simple "music player" on the clientside, then I'll try to do more than that. FMOD Studio seems really pretty. :o

Also, in DevVideo 3, I mentioned some stuff about bounding boxes and vehicles. TL;DR you can't rotate an AABB with pev->angles properly. But, a friend told me about a special model flag, that's used by monster_tentacle, which essentially uses hitboxes for collision. Mmm, definitely seems better than AABB, even though I'm pretty sure this will have its own flaws too. But I'm more willing to accept those flaws than the ones of AABB.

Also, something I haven't shown in the video, but probably have shown here (or not?), physics.
Here's a link. The Bullet physics engine integration is going fine enough. Just gotta set up some debugging lines so I can see my collision shapes. Stuff seems somewhat off already.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 1 week ago2019-08-10 15:36:12 UTC Post #342989
FMOD now works. :zomg:

Long story short, now I can play music with it. There's a special "music" folder inside the mod folder, so when you use a sound name like "abcd.ogg" in a music entity's keyvalues, it'll look for modfolder/music/abcd.ogg
Also, the DLL file is now in cl_dlls, instead of the Half-Life directory! Yay! (big thanks to Solokiller)

Currently, it works by sending a user message with a string. What this means is, it would be very far from optimal when it comes to network performance. So for entities that emit sound, like monsters, breakables etc., that would be a lot of bandwidth. So I'm thinking about replacing a variable number of bytes with just 2. Up to 65535 sounds should be able to be precached per map, cuz' c'mon, who's gonna precache more than that in a GoldSrc mod? Sheesh.
Now, I believe that I could stick to sending strings for music entities, as long as short filenames are used. But then again, 65k is more than enough IMO, so I guess music could go to the "sound cache" as well. :walter:

Now, something more conceptual, that I haven't started working on yet.
Do you like bows in games? I personally do, especially the one in Crysis 3. ^^
I think a lot of cool puzzles could be made for it. There will be a jungle area where the player is alone most of the time, so it'd be pretty nice to have that instead of firearms. :P
Admer456 Admer456Lean, mean, mapping machine :3
Posted 1 week ago2019-08-13 12:20:53 UTC Post #342994
Do a compound bow please. With modable strenght for different purposes... and also different arrows!!! (explosive, hunting, shredding, poisonous, flammable...). :crowbar:
Posted 6 days ago2019-08-13 16:45:32 UTC Post #342995
I was thinking of a more primitive one at first, then you pick up, or upgrade to a compound bow later. And of course, there will be different types of arrows.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 6 days ago2019-08-14 05:42:23 UTC Post #343001
I´ll keep an eye on UAS!!. :crowbar:
Posted 5 days ago2019-08-14 21:27:20 UTC Post #343008
I had a fascinating playtest session with my brother last night. The vehicles work rather well in multiplayer. So yeah, vehicle deathmatch is definitely gonna be a thing. Sure, it's never gonna be as smooth as it is in singleplayer, but the vehicles are very driveable.

Originally, I was going to do a simulation for cars, but hey, this is an action comedy type of thing (apart from the other characteristics of the mod). So I'll do a bit of more liberal car physics. Think of GTA: San Andreas for reference.

I could do what Gran Turismo 1 & 2 did, which is having a separate mode for arcade and simulation driving, though that's pretty much 2x more work. On top of that, you gotta remember that racing sims use really high-poly tracks so that they're smooth enough for the simulation to be accurate. It'd require QUITE some clipnodes for that. Unless I use Bullet for the simulation mode, where I could easily use the external physics mesh.

Hmm... for now, let's just stick to GTA:SA style arcade driving. Also, for the sake of network performance, I'll have to ditch the idea of assembling a car out of different pieces. I mean, let's take into account a veh_car_base, with 4 veh_wheel entities, and a player in the car. That's 6 whole entities! That means it'll take 3x more origin and angles sets. According to my calculations, that's 96 bytes + vehicle itself + the player = 144 bytes total. (only taking into account sending the floats in pev->origin and pev->angles).
Now, sure, I'll keep all the functionality, but for MP maps, you're just gonna have to use 'whole' vehicles if you want better network performance.

For the entire picture, here's the plan:
  • veh_car - car entity that supports all kinds of parameters set by the mapper: model, seat number, engine characteristics etc. Only potential issue with this entity is the fact that this is gonna take up quite some data in the entity lump. There are gonna be many parameters to be defined, most of which should have default values, however.
  • veh_car_base - car entity that "assembles". You attach other entities onto it so it can become drivable. (implemented)
  • veh_[insert a real-world car name] - a preset car entity. For example, veh_yugo - acts like a Yugo 45, looks like a Yugo 45, drives like a Yugo 45.
  • veh_base - the original drivable chair entity. (implemented)
  • veh_base_ms - the original drivable couch, multi-seated entity. These two might get removed or renamed. (implemented)
  • veh_seat - a seat that you can place. This would be a normal chair that you can sit on. No driving. By itself, it's actually an invisible point entity, and yes, you can use it to attach to veh_car_base. (implemented)
  • veh_wheel - a wheel. By itself, it does nothing. Naturally, it might roll away if it's on a slope. In a veh_car_base, it'll act like it's supposed to. (implemented)
Now, if we go a bit farther into the future:
  • veh_tank - self-explanatory.
  • veh_boat - regular boat. You can choose it to be a motorised boat or a boat that you row, which you'd have to use a special weapon for.
  • veh_boatmg - boat with a mounted machine gun on it. Motorised by default, but you can also choose to row it.
  • veh_sub - a submarine type of vehicle. Moves only under water, and players in it won't drown.
  • veh_heli - a helicopter type of vehicle. W and S control it vertically, while A and D rotate it left-right. To steer left, for example, you'd have to pull your mouse to the left, rolling the helicopter left. Then you'd push the mouse backward (or forward) to tilt the helicopter up. Think of it as a joystick.
  • veh_plane - an airplane type of vehicle. Controls are just like the helicopter's.
  • veh_ufo - imagine the submarine, but in the air. It's basically not affected by gravity. It's controlled like a helicopter.
  • veh_sship - a spaceship type of vehicle. It's controlled like a plane, except it isn't affected by gravity.
  • veh_bike - a bicycle or motorcycle type of vehicle, depending on the mode. Just like the boat, it can be motorised (hence it acts like a motorcycle), or it can be powered by cycling, which would act rather similarly to GTA:SA. If you hold W down, it's cycled normally. If you tap W fast, you'll cycle faster.
Lastly, imagine almost all of them with "mg" variants. There would be some sort of weapon, either a machine gun type, laser type, or rocket launching type. Now, of course, you'll be able to choose whether the vehicle will have the driver as the gunner (like in HL2 when you use the airboat, or the buggy), or if you'd rather have a separate seat for the driver and the gunner.
In the far future, we might have NPCs that drive vehicles, and, heck, even ride-able NPCs. Imagine riding a Gargantua, LOL.

You might be asking, why all of this? Will all of them be used in UAS? Not all in the singleplayer campaign. Vehicles that the SP campaign doesn't utilise can be found in some of the MP maps, as well as minigames, which are accessible in singleplayer. However, keep in mind that this is not only a SP-MP mod, but also a mod base which others could use in the future. :3 (the 'base' can be downloaded separately)

Anyway, I mentioned rowing a boat. A row would not be a weapon in this case. This mod's gonna have 'tools', which are basically weapons but instead of damaging entities, they provide certain functionality with them.
The most obvious example is a paddle tool to row a non-motorised boat. Of course, it can be used as a melee weapon. Some tools can double as weapons.
Other tools will include:
  • Worldcraft WC2.0 (original) - yes, a multimetre. You'll have to measure electricity in the mod at some point. You'll see why. If you don't mind the spoilers, I'll tell ya right away.
  • Lockpick. This is pretty self-explanatory.
  • Rock. To distract enemies a la Far Cry 1.
  • Car keys. Logically, to start a car, you need its keys. Either that, or try jump-starting the engine, which is gonna take longer.
  • Phone. You heard it right. A phone is going to be quite useful in the mod. Organise actions in missions, call people, and whatnot. Unlike GTA, however, you'll have to charge it wherever you find a power source. Some sockets won't have voltage in them, and you'll use your trusty WC2.0 to check if they have them. But don't worry, the battery should last long enough. :D
  • Universal Remote. Simply put, imagine controlling a little rocket launcher from the distance, or a mini RC car.
  • Grappling hook. Very good for setting up a rope to the top of a tower. Or if you wanna do bungee jumping. However, don't let someone shoot it. It has its counterpart.
  • Climbing axes. You can climb walls with ease.
  • Parachute. Self explanatory.
There's more stuff than this, but I don't want to count all of them. Now, you might say that's a lot. And you're right. But you can't carry it all at once. Well, you can, but you'd be VERY slow. Items, tools and weapons will have their own masses, and the greater the mass, the bigger the slowdown will be.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 1 day ago2019-08-18 23:32:12 UTC Post #343047
So, next up: physics.
27 cubes of phys_base27 cubes of phys_base
You might notice that the boxes clip into the floor by approximately 1 or 2 units. That's because I currently don't have a proper thing for map collision. Instead, I made a phys_staticplane to prevent the boxes from falling through what we see as the floor.
I'll resort to an external mesh for this type of stuff. Reading geometry from the BSP is cool and all that, but what if we want a separate physics mesh for the map? Eh?
As of right now, the system goes like this:

mapname.bsp - actual map
mapname.bsp.obj - .obj model file made from an exported .map file. It's easy to do with tools like Crafty or Noesis or whatever you use.

However, I might end up writing a tool that reads a .map file and just converts the thing to .obj. It'd be kinda cool to add new stuff to my mapping workflow. :P (or whoever ends up working on the mod, or using the mod base)
Obviously, I'm not planning to replace GoldSrc's physics anyhow. Just adding special physics entities on top of the whole thing. And NO, no ragdolls. I know I'm crazy, but not THAT crazy.

Of course, maps will have the option to have or not have physics. It's as simple as that. Vehicles may or may not require physics. I'll have to see about that at some point. Probably not though!

Either way, currently I'm juggling through pointer hell, because there seems to be some stuff about the map collision mesh. Pretty sure it's a null pointer somewhere. Read access violations can be a beach. (you know what I really wanted to say)
bvtBvhTriangleMeshShape is being used. Though I guess I just need to read the documentation a bit more.
Admer456 Admer456Lean, mean, mapping machine :3
You must be logged in to post a response.