Jump to content

loading scene classes without loading scene


Chiblue
 Share

Recommended Posts

I am in the process of building a dedicated server for my game client... my problem is that all the information required by the server so that it can control the clients is contained within the scene.. What I would like to do is basically load certain classes from the scene, things like weapons, characters, spawns, bit controls etc... but I do not want to have the scene run on the server. Is there a way that I can load the entities I need from an editor scene file without having to establish a framewerk etc.

If it's not Tactical realism then you are just playing..

Link to comment
Share on other sites

You would have to parse the sbx file yourself, and load that information into your own structures. You won't be able to load them into any LE structures without having graphics. So if you have a Gun class you can load the information from parsing the sbx file (which is just plain text) and create your Gun class on the server, but your Gun class can't use a TEntity anything like that.

 

The downside to doing this is that you can't use any LE functions on the server if you don't want to init graphics. For example if you want the server to do a PointEntity() you would have to write your own version of it. If you want your server to have collision callbacks you would have to handle that all yourself.

Link to comment
Share on other sites

I you want an actual pointer to a TEntity using LoadModel or something, then no. Basically all commands require that LE has been initialized and the server therefore needs to be SM3.0 compatible.

 

You can however use some other networking library (SDL_net, RakNet) and read the SBX file by hand. It's plaintext anyway.

Link to comment
Share on other sites

Is there an specs or doc available for the structure of the sbx file?

 

It would be useful to know what could be in there so I can build a process to handle anything I find and how it is structured?

 

Also I will need dimensions of the models loaded...what do I need to intialize to use loadmesh?

If it's not Tactical realism then you are just playing..

Link to comment
Share on other sites

Also I will need dimensions of the models loaded...what do I need to intialize to use loadmesh?

 

You have to have a graphics card to capable to run LE to use LoadMesh(). Like we are saying any LE commands you cannot use on a server that doesn't have a graphics card. It's an all or nothing thing.

 

There also is no spec for sbx. It's been described as obvious, and for the most part it is.

Link to comment
Share on other sites

You don't need necessarily any LE functions on the server, but you can have a seperate Game Master client using LE which connects to the server and handles all other clients. Alternatively you can also integrate the server logic in the clients, then you don't need a seperate GM client. This would be actually more useful, since then the game works also in offline mode.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

What Lum is saying is that you can't use anything LE API related at all without a capable graphics card, so in order to run servers you have to jump through hoops. If you want physics you have to do it yourself with a physics library. If you want to store data and manipulate that data you have to make the structures and methods yourself. You can't have any LE related API stuff without a valid graphics card.

Link to comment
Share on other sites

Alternatively you can also integrate the server logic in the clients, then you don't need a seperate GM client. This would be actually more useful, since then the game works also in offline mode.

 

problem here is you hit a limit on the number of clients that can connect. Games like cod mw2 do this but you are limited to the number of clients if you want 50 or more clients you need a dedicated server.

If it's not Tactical realism then you are just playing..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...