Jump to content
The Lotus Eaters: Share Bug Reports and Feedback Here! ×
The Lotus Eaters: Known Issues ×

Simplify Several Random Events And Physics With Prng And Preset Routes.


BrazilianJoe
 Share

Recommended Posts

I propose that a pseudo-random number generator with high period (1000s of values before the series repeat) is used along with a predefined set of trajectories for several instances in the game, to simplify the amount of synced data between clients.

 

 

 

On high lag interactions I see that when i e.g. open a 'treasure chest' and it's full of credits, they update their position very very slowly in small steps until each credit stick hits the ground. It also takes several seconds staying on top of them for the player to pick them up. On high-latency survivals, sometimes it takes minutes for the player to pick up these, making the game unplayable.

 

Picking up opportunities for pseudo-random number generation.

 

The devs surely know, but I will explain to the other players. A pseudo-random number generator is actually a simple function which gfenerates thousands of numbers non-serially, and after certain point, eventually the series starts repeating itself. with the function and a seed number, the number in the series can be instantly recovered. 

 

How does it help the game?

 

Weapon spread for instance. A prng for each weapon is convenient, in it can be divided in two parts: one parts results in the angle at which the shot will deviate from the barrel circumference; the other part is the intensity of the deviation, from the barrel axis. 

 

Network message explained:

 

Player started pressing primary weapon fire at time X with random seed Y for spread.

 

as the player stopped shooting:

 

Player stopped pressing primary weapon fire at time X. 

 

It does not even need to send the final seed. The other clients can infer it from the time delta between the <start shooting> and <stop shooting> events, using the weapon rate-of-fire + mods to calculate it.

 

A simplified preset number of trajectories for items being dropped from treasure chests, breakables and enemies can also reduce the number of items which need to be synced/updated between clients.

 

Say, for instance, that the 'drop map' of anything has an angle: the direction to where it will fall from the center of the drop spawner; and a distance - horizontal distance at the ground level from the center of the drop spawner.

 

Based on the location on the map, the drop spawner will have some angles and distances off-limits, to avoid having stuff being thrown off the map or through walls. treasure chests at the walls will only have 50% of their drop map available. breakables and enemies on thin catwalks can have the farthest portions of the drop map on each side culled. (No more Alad V sensors falling out of the map yay)

 

Having only valid places in the drop map, and a single seed number created at the time the object was created (not killed) makes it super-simple to just say:

 

Network msg: 

 

Object was destroyed/opened. Spawn drops.

 

And the engine would just know how to move the drops, generating a sequence of numbers from the seed, each one to randomize the drop of one item into one of the valid places in the drop table. No position/velocity/whatever physics needs to be synced. 

 

As soon as the object touches the ground, the drop map releases control of it, making it subject to normal physics effects.

 

Since this is not physics based, it could make some awkward movements such as having stuff fall to the ground first, and only after it touches the ground a zephyr's cyclone can suck it. Even this can be solved if the 'drop map' has a hit box - or several. according to the hit box(es) hit by the cyclone, or carrier vaqccum, or other power which would act on it, the drop map can release control of the item and declare it 'physically active', making it subject of the normal game's physics engine. 

Edited by BrazilianJoe
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...