#server stuff

1 messages · Page 1 of 1 (latest)

olive gorge
#

.

wraith charm
#

before going any further, I would highly suggest doing benchmarks and measuring throughput

#

for the sake of the product

#

You really shouldn't need to send out updates more than 30 times per second as well.

#

you can probably do 1 per second if it's just updating to a web server.

#

When I was first starting networking a few years ago, I used JSON as well, for state updates. After about 20-30 objects in the scene, the game became extremely laggy due to JSON itself.

#

It's just not meant for realtime stuff.

olive gorge
#

in my own personal projects, i only use it to save load data

#

like on start and end of the game

wraith charm
#

yeah single time stuff like that isn't a problem

#

The problem with JSON in this case, is that you're allocating a bunch of strings every time it needs to read data

#

which is extremely slow

#

anyways I won't bother you anymore. Heed my warnings.

olive gorge
#

kay thx , at least if the boss is immovable

#

i can still use it in my projects

wraith charm
#

If you have questions regarding networking, just ping me

olive gorge
#

this is server logs

#

i guess its update based, the trace is way too long and i give up to find it

wraith charm
#

yeah uh

#

your boss doesn't sound like he understands what he's doing

#

I assume you've only tested this locally? Not across the internet?

olive gorge
#

he tested, somehow it works, but we got tremendous amount of bugs

#

it really works tho

wraith charm
#

What is this for though? You buy the software, then do you setup your own web server for it to use?

#

Or do customers use your web servers?

olive gorge
#

the boss is ambitious about being 3A company, so he wants to follow every footstep a normal 3A company will do

wraith charm
#

this is not AAA

#

very far from it

olive gorge
#

he has the ambition

#

he wants to setup server like 3A companies, from zero

wraith charm
#

So like, customer buys the unity plugin, then they connect to your companys servers?

olive gorge
#

our customer is local university, teacher will buy one of our setup scenes, and be able to access part of our setup functions, so they can create their own NPCs and scene objects

#

its for metaverse learning

wraith charm
#

You don't think a government facility is going to be angry when this eats up 300mbps per client?

olive gorge
#

we made the scene, implemented necessary system

#

welp lol, they seemed more pissed at the bugs lol

wraith charm
#

I can get, easy, 1000 frames per second in my editor

olive gorge
#

we really havent dived into benchmark that thruoughly

wraith charm
#
float tickRate = 30; // Execute our custom loop 30 times per second.
float myFixedDeltaTime = //  (1 / tickRate) will be 0.033 at 30hz tickrate. This is the amount of seconds between each tick.

public void Update() {

        // Timer starts at 0. Every frame, we add the seconds since last frame. Like below.
        timer += Time.deltaTime;

        // Is our clock ready to tick? While loop prevents the clock from falling behind. Could execute multiple times in a single update() just like unity's fixedupdate().
        while (timer >= myFixedDeltaTime )
        {
            // Take away the delta time that we just consumed
            timer -= myFixedDeltaTime ;
            MyCustomFixedUpdate();
        }
}

public void MyCustomFixedUpdate() {
 Debug.Log("I'm running 30 times per second!");
}```
olive gorge
#

but what i know is, this game is mobile game, and the phone models from 2016-2018 cant withstand the load

wraith charm
#

Heres how you make a clock in unity

#

you should save that code block somewhere btw

#

It will only tick n times per second

olive gorge
#

oh timer

wraith charm
#

it fires off at a tickrate

#

with extremely minimal overhead

olive gorge
#

i have similar timer in my personal project

#

its for controlling firerates in shooting games

wraith charm
#

yeah definitely put your json stuff in one of those

#

that alone should give you a bunch of performance back.

#

anyways I'm going to get high and go to bed

#

good luck with the project