Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / NetVarInterface - NVI

Author
Message
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 15th Jan 2009 23:47 Edited at: 15th Jan 2009 23:53
There are several forms of the name for this.

NVI is the abbreviation.
NetVarInterface is the short-hand term.
Networked Variable Interface is the full name.

The name says it all. It's a platform-independent interface to store variables (strings, integers, float values, and even Vector3 values). What's the difference? It keeps track of what has changed, and gives them GUIDs (globally unique identifiers) so they can be used with your clients.

Too bad I'm not entirely done. There's a separate version for servers and clients. I finished the server part, but have yet to start with the client (just a modified form of the server version).

Basically, you get an NVI and you can store values by name in the interface. Then you can loop through the vector of NetVars and send them if their HasChanged() method returns true. If not, why send them and waste bandwidth?

Enough explanation, have at it.

NVI.h (53 lines)


NVI.cpp (248 lines, yes, it's not quite so small!)


It also requires my Vector3 class. It's very easy to use, don't worry.

Vector3.h (71 lines)


Vector3.cpp (130 lines)


Yep, Vector3 has it's own Intellisense interface via triple-slash comments!

If you read through the source, you would know this, but yeah, you don't have to read it all.

NVI casts anything. If you store a Vector3 and try to get it as a string, you'll get "x,y,z". You can add in exceptions if you want, but I like the looseness of it myself. It's a lot like KaosScript in how it stores things.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 16th Jan 2009 17:18
Okay, I'm stupified.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 16th Jan 2009 23:54
It just makes making a multiplayer game much easier.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 17th Jan 2009 01:11
Looks pretty neat. Look into the CDiggins::any datatype (Google it). It can hold any piece of data of any type.

JasonC
15
Years of Service
User Offline
Joined: 1st Jan 2009
Location:
Posted: 11th Feb 2009 06:30
Awesome man! WTG

Login to post a reply

Server time is: 2024-09-30 15:36:44
Your offset time is: 2024-09-30 15:36:44