Hey guys. As some of you already know, I’ve been occasional working on my own custom game client. If you guys want to see what it is like so far, you can do so here:
I want to know what you guys are specifically looking for when you create your server experiments. I ask because I am getting to the point where my client can take off in a couple different directions. First, let me explain how it currently works:
Everything in the game is a scene object. There are 4 types of scene objects: blank, static image, animated, and tiled image. Scene objects can have any position, scale, or rotation. Levels are just scenes that contain a bunch of scene maps. If you want to think of it in Graal terms, the gmap is the level and each individual .nw file is just a tiled image scene object arranged to resemble a connected set of levels.
There is really no analog to Graal’s levels. You can see this in the client currently: I load the starting level twice, scale it, and make it maneuverable/rotatable/scalable using the keypad. If you wanted to, you could make the player BE the level. The player can be any scene object, in fact. Because of this, you can’t easily manipulate level tiles like you could in Graal. If you wanted a destroyable bush, the easiest thing to do would be to make the bush be a scene object that hides itself when attacked.
Next, I currently use AngelScript for scripting. It is a C++ like scripting language. I chose it because it was suuuuuper easy and quick to implement. I, of course, would be open to changing which scripting language the client uses. What I want to touch on, however, is the “class” system. Every scene object is part of a class. Classes have their own attributes (more on this in a sec) and their own script. In fact, a scene object can have a script in its class, and its own custom script. Classes are just ways to easily make duplicate scene objects. Also, each server has its own “client script” file. All movement and client logic is scripted. The current client script emulates a Graal-like experience, but it could easily be modified to provide a platformer experience. This would allow servers to develop their own custom movement system without bothering to hack around a built-in system, like we have to do with Graal.
Next, I made the system incredibly flexible by way of an attributes/properties system. Properties are static elements that every scene object has. They are: level, x/y/z positions, x/y scale, x/y velocity, x/y force, torque, rotation, direction, and image. Technically, properties are just pre-defined attributes. Now, what makes everything special is that classes and scene objects can create their own attributes. The attributes will be shared across the network with all the players. Think of them like your gani parameters, except you can make however many you want, and with whatever name you want. These attributes can also be used in ganis. You could, for example, create an attribute that specifies the location of an image in a gani.
Now, I want to mention local/global scene objects. I currently have local/global scene objects stored in different places. You have to specifically ask for a local/global scene object in the script. This is related to the scene object’s unique ID number. Graal gives each NPC a unique ID. Global NPC IDs start 50,000 and go up. This creates a unique problem where you could run into issues if you have over 50,000 non-database NPCs. It is a large number, but that issue still exists.
Currently, I use Box2D for physics. I am probably not going to change that.
I am also contemplating getting rid of the gani format, or at least adding support for Spriter.
Now, I want to know things like:
- Should there be a disconnect between levels and scene objects, like how Graal does it with levels/npcs? Basically, should I just use actual tiled levels?
- Would a split between local/global scene objects bother anyone? Or would people prefer it be like Graal, and just make NPC IDs > 1,000,000 or so be global NPCs?
- What features would you say are must-have required? E.g., scriptable GUI, color modification, etc?
If I can think of anything else, I’ll ask. I just want to get a feel of what people would expect and would like to work with. If you have any questions or need things clarified, feel free to engage me with your own questions.