Showing posts with label simulation. Show all posts
Showing posts with label simulation. Show all posts

Sunday, 11 June 2023

React Physics 3D : First Impressions

With my home engine coming to the state of being able to visually represent a world and move about within it, I've decided to set about sorting out a physics representation.

Very much as I did with the mathematics where I set about writing all my own code and then adopting a library; in order to best learn the process from first principles I also set about writing my own physics engine and visualizer (the latter using the much more familiar to me fixed function pipeline of DirectX 9 - Yes it still has a use in 2023!)

The physics implementation I went with was a simple rigid body test for cuboids and spheres.  Then a ray cast.  At which point I set about seeking a library as it's a huge topic I didn't want to sink too much time into.

I settled, after about a fortnight of reading and trying on React Physics 3D.

My initial impressions are that it is easy to set up, supports CMake and just worked; though I'm yet to fully get to grips with it, I am happy I have my world and simulation set up and working.

I've also happily separated my game objects from my visual objects with the use of my Ecs and I'm able to do the same, by registering a new Ecs update system with my entity list and simply piping the commands to create and destroy physics objects per frame.

The update pumping of time matches my engine instantly, so I had a lot of wins.

However, I am not building in a permissive manner, I have maximum warnings as errors, I have strictness on and permissive off; I also remove all compiler specific extensions, so I am using only C++ in it's rawest, most portable form.

Immediately, even though I've compiled React separately and then just link to the library statically, I have a bunch of the React headers giving me errors; notably map, BroadPhaseSystem and DefaultLogger.

The first two are the same sort of issue, which just surprised me, there's a constexpr uint64 set to minus one (so it's max) an unsigned value set to a signed negative to under roll it... Well it's quite bad practice:

static constexpr uint64 INVALID_INDEX = -1;

And I immediately updated this to:

static constexpr uint64 INVALID_INDEX { std::numeric_limits<uint64_t>::max() };

I may feed this back to the author, he most likely knows, maybe there's even a reason for it, personally I'd always stick to numeric limits and max in this case though, not least as it is constexpr and not a hack ;) 

The other one was a lambda expression in a call to std::transform for making all logging strings lower case, the code simply used ::tolower.  However, it was not type safe, it was converting int to char, but that's not explicit and so I changed it over to read:

std::string toLowerCase(const std::string& text) {
                std::string textLower{ text };
                std::transform(textLower.begin(), textLower.end(), textLower.begin(), [](const char& character) -> char { return static_cast<char>(std::tolower(character)); });
                return textLower;
            }

The lambda here is hard to read, so lets split it out:

[](const char& character) -> char 
{
    return static_cast<char>(std::tolower(character));
}

We take in a character, return a character, explicitly, so we have to cast the int return of std::tolower... simple really, but hard to read.  It compiles down well; but just using "::tolower" well that's a decay to int and you have to be permissive in your type exchange... I don't like that, express yourself in your code type correctly, and it'll be type safe.

Friday, 4 March 2016

Arma 3 - Coop - Medic by Night, Light Machine Gunner by Day

Today's coop round finds us running around as a medic by night, and then a light machine gunner by day...


I also get very grumpy with a certain helicopter pilot... or is that wanker who thinks he can DJ in a game?....

Wednesday, 24 February 2016

Arma 3 - Coop Play

The wife and I have spent sometime, getting off of our dearth of playing PVP games, and we've been playing a lot of Arma 3 in cooperative mode.


We have also started to stream regularly on twitch, www.twitch.tv/xelous, so catch us there.

We bought Arma 3, as I think Arma 2 and it's mods are starting to look very old... It's been a great experience so far, however we are getting random crashes from the game client.

Proper nasty C++ object reference null pointer crashy horribleness.

Tuesday, 23 September 2014

OpenBroadcaster - x264

I spent a bit of time last night messing around with OpenBroadcaster, capturing some of my Simulated Battles in WarThunder...


As you can see I've got my name, the game and what I'm up to added as text legends, I've included the track IR window and the game itself.

It worked, I've captured like an hour of game play, including three air kills (which was good going in the Italian G50 I was flying).

My main challenge is playing about with the settings... So I have an EVGA 770 GTX SC graphics card, so not a slouch... And my CPU is a Core i7 (8 threads) running at 3Ghz (I can over clock it, but its not at present)... and I've got fast cooled DDR3 RAM...

However, the x264 encoder really sucked the life out of my machine, making flight hard, but the video very poor quality.

After that I set about looking at using NVENC, but it came out as this very strange sort of effect where as things moved the screen recording was fuzzy, as the screen stopped changing so much it would spring up into perfect detail, and then slowly degenerate again.. Pulse of detail, then blurr... over and over... so it was strange.

Tonight, I am intending to mess about with my settings some more, and if all else fails I'm going to revert to capturing the game with nVidia Shadow Play and using an editor to overlay text.

Saturday, 13 September 2014

Elite Dangerous - Still Not Going To Play It

I am not going to play Elite Dangerous... Let me get that said, not because I have to eat humble pie and say it does not look a bad game, and unlike my prior posts David Braben has proven himself to NOT be a snake oil sales man, as he has delivered the game to the masses (least as a test/alpha/beta so far)...

But, that said, watching someone competent play is interesting, prior to seeing the below videos I've only watched some mediocre coverage from Jingles and then the terrible developer example videos from back when they were still looking for online funding...

Ralfidude however, a YouTuber with a plethora of DCS and other flightsim coverage, has taken to the space ways, and he's given us these few videos with his coverage of the game... Looks good.


My problem with the game is not the game, I love Elite, and I understand it there is a single player game involved in this title... However, its the online play which counts and it seems to me there are too many ways for people to grief.... And I did all the griefing I needed in Eve-Online.


I'll admit though, Ralfi's Videos have me tempted... But not for £50... Fuck that price point with their millions upon millions start up capitol already in the bag!

Monday, 1 September 2014

WarThunder - Simulator Battles

I've spent a lot of time playing WarThunder, I've in fact only played WarThunder this weekend.  Importantly however, I've almost exclusively been playing Simulator battles... Not with any luck, I hasten to add...

I've spent a lot of time looking at clouds and seeing nothing, but I have been flying well enough and getting used to take-off and landing procedures.

I have to give a big shout out to "Viper" a nice chap I met in the Simulator Battles room... And whom took me up in a battle - where he absolutely owned - in ME109E3's... And where I ended up hit by flak and returned to base just as the wife started shouting me... She didn't care I was fighting a war... But hey ho...

Later I flew out in my P47 and was immediately bounced from above, out the sun, by Hayabashi's...

Even later still I flew out in my HE112, and saw nothing but got killed by AI - yes I could not even out fly AI..

And finally I flew out in my FW190A1 again, saw no-one... Finally spotted a target, dove on it and got a couple of hits, pulling out however I suddenly saw above me two La5's... And they tore me to shreds.

I think I'm okay at flying... I'm below average at spotting.. and I'm utterly useless at manoeuvring.

Now I have lots of screen shots, however, I can't find the memory stick they're saved on, so trust me they were stunning.

But later on Sunday night I came back to play again and my funds are exceedingly down on WarThunder,  so I played a few Realistic Battles, made 100,000 credits and called it a day.

I've unlocked two aircraft this weekend - the upgraded P47 and the Fw190-A5... Neither of which I can afford...

But I'm determined to play more Simulator battles.

Sunday, 31 August 2014

WarThunder - Experiments - Fw190-A1 Taxi Handling


Having read this page we have the following snippet...

"The tail wheel is freely pivoting but can be locked by holding the control column back as on the P51B"

This leads me to want to experiment with my Fw190 take off procedure, which right now is:

1. Apply Brakes.
2. Start Engine.
3. Check Rudder trim is neutral.
4. Apply 25% power.
5. Release brakes.
6. Apply slight right rudder.
7. Progressively increase power and right rudder until rolling.
8. Allow the tail to rise at 70 mph.
9. Rotate and pull up at 110mph.
10. Retract gear.
11 At 130mph and climbing raise flaps.

It may have to become:

1. Apply Brakes.
2. Start Engine.
3. Check Rudder trim is neutral.
4. Apply 25% power.
5. Release brakes.
6. Apply slight right rudder.
** As the airframe straightens, pull the stick full back to lock the tail wheel **
7. Progressively increase power and right rudder until rolling.
8. Allow the tail to rise at 70 mph.
9. Rotate and pull up at 110mph.
10. Retract gear.
11 At 130mph and climbing raise flaps.

We can also make use of this, if in the game on the landing, as we flutter on near zero power and touch down, pull the stick full back to keep the tail down and lock the straight running tail wheel.

----

Addendum

I've just found this item on DCS handling of the Fw190-D9... You can clearly see that the rudder use is not violent here, and the pilot talks of gentle use of the rudder.



I will be experimenting with the brake stearing in WarThunder later this evening (written Friday before posting, so there maybe another Addendum).


Tuesday, 3 June 2014

GeForce 770 GTX SC on WarThunder and World of Tanks

I want to enter a decent picture for the monthly Screenshot of the Month Competition over at WarThunder... I figure applying the vintage texture filter is going to be a must, and I'm going to have to find a reference shot then build skins for the aircraft involved.

Since I'm a bit of a billy no mates its also going to be important that I have something which is perhaps just my aircraft and some action in the foreground.

Nailing the aircraft custom skin is going to be the key...

But what pictures are floating around the internet for me to take on?


Spotting that one was promising, the P47 is not an aircraft I have unlocked yet, but I'm currently researching it, which would give me time to work on the custom skin... I think the difficulty would be finding that exact structure in the game and flying near it...

I've also looked at real-world footage of the BF110, but can't seem to find anything which fits...

I also spotted this image, which will require a friend or an AI stuka...


But, wait wait wait... You've all seen my screen shots and that I have either used a 540 GTX or an older 260 GTX Graphics card to play WarThunder... How can I possibly take really high quality screenshots?

Well.... Drum roll please... I've just been informed that an item from my Amazon Wish List has been purchased for me for my Birthday, which is very soon... The item is....


Oh yeah, an Nvidia GeForce 770 SC with ACX Cooler, not a 780, not a titan, but price versus performance for my rig this is the beefiest thing I've ever ever put in a PC my end.

And I am going to run WarThunder and World of Tanks in such stunning high detail that I'll get myself a case of "The Apocalypse Now's"... You Wouldn't know man, you weren't there!