Hey everybody. I have some news. I am going to take composing classes soon. Whooppie!
My work is moving forward in speed of a snail, however, something is being done. Just updating.
Printable View
Hey everybody. I have some news. I am going to take composing classes soon. Whooppie!
My work is moving forward in speed of a snail, however, something is being done. Just updating.
Sounding good, Psy and Igor. I am still recovering from my illness, but I will soon be back in action =).
Z.
I think that I have figured out the theory for interpolating across a triangle. This will be used for the terrain stuff =).
Z.
Excellent. Zaei, will ToW be able to support bumpmapped textures?
Probably. =).
Z.
LOL
The networking wasnt sending / receiving packets properly today when i tried it for the first time using the converted dll. I realised that when using code from HawkNL i changed the packet prefix from NL to DS for sending but NOT receiving.
Anyho i got it fixed and taking a step closer to getting this done :D
Zaei, do you wish for the networking module to use classes or to be done as more of an API ?
I suggest classes coz this means i in effect make a wrapper for L1 and create a modular part for you to use.
Classes =). Its the best way =).
Z.
Im kinda glad that i decided to use HawkNL as a basis for the net module, i have converted it and removed some extra code that we dont need at the moment (cross platform and extra protocols).
I have also noticed that the system doesnt shutdown sockets very friendly so im just about to add it.
Does create a nice solid base to build the module upon :D
I got connections working, in supprisingly little code :D
now to work on da protocol and data sending.
Are we going to use TCP for the chat before game and then UDP for actual game data ? If so im gonna have to work a way of sorting that out because u have to init the DivSock (HawkNL conversion) then select socket types, then shutdown, then u cans elect another. This means u loose all of the connections :(
Im gonna have to store them and get ppl to rejoin. Or maybe some how have to instances of DivSock, and do it that way (in effect have to servers, chat and game). If i wrap it into a class, coz atm its just like a normal API.
Wrap in into a class. We HAVE to use UDP for game data, because we are going to have a lot of data. Perhaps you can figure out a way to issue each user a unique session ID, so that when they reconnect, they have to specify the issued ID before they can get in (CoCreateGUID() would be a great way to do this...)
Z.
I tried wrapping it into a class and it still doesnt allow two instances in the same app, i tried creating sub threads but same problem.
Im gonna do it so they join and chat etc then when they want to play it chucks them all, re-starts in UDP mode and they rejoin.
A little update from me. I go the system made up so the server listens on a Reliable Packets stream for all the actual setting up and chekcing. Then, it keeps that open for lobby and in game chat to be sent. and opens a UDP socket to the client for game data.
Thus each thing has a connection to the server via TCP/IP and UDP/IP
:D:D
Perfect for us.
Nice, Psy =).
Tomorrow I want to start on the UI again, and get that running. After that, I want to get the terrain working fully (still working it out =). Then skinned meshes.
Z.
How much level of detail will we need for the textures? I may be able to do some of them. I'm thinking: 256x256 for characters, 512x512 for the buildings, and 1024x1024 for the ground (letting us have some nicely detailed stuff!
Make sure to put in some S3TC and DXTC code there ;)
The Server / Client is coming on well, its farily secure atm, when a user connects, it checks if the server is full, if so it boots them, if not it opens a UDP connection back to their computer. (Thus verifying their ip address), if this connects then all is ok, if not then they get kicked.
If all is ok at this stage theyre sent a +OK message accompanied by the server/game name. the client then replies with a HELO statement, replied with the index number, then the player id.
these can be used to check the user is true at any time because the playerID is taken from the index and a serverID, thus u cannot hack it coz u dont know the serverID. it can be freely changed via changing an algorithm.
The client then sends the username and they enter chat mode which is when all data is setup and the user can talk via the lobby with the others).
Im gonna add a client version checking thing which has the latest version stored and the clients send it when connecting which means older versions cannot be used.
This all takes place in a very quick time :D:D
Those levels sound fine, Sas. We can change them at any time, to make sure that the textures for units match the level of detail on the ground (i dont want there to be a distinct loss of quality between anything).
Psy, you might want to use a DLL to do the serverID thing. Simply create a DLL that exports a single class. The class just creates the serverID, and returns it. Usage would be like this:
The DLL would the derive from ServerIDBase, and implement the serverID algorithm in the GetSID member. In network initialization, you just specify the DLL to load:Code:class Network // fake =)
{
...
ServerIDBase* sID;
...
};
class ServerIDBase
{
ServerIDBase()
virtual DWORD GetSID()=0;
};
To get a server ID, you just use sID->GetSID().Code:...
typedef ServerIDBase* func();
HANDLE mod = LoadLibrary(x);
func* f = GetProcAddress("GetServerIDBase");
Net->sID = f();
...
Z.
So, they can load up modules for serverID and playerID generation ??
I can probably implement somehting like that.
Would that perhaps be a bit too complicated for standard users because if you think about this, were gonna have a web page with a list of servers or summat which ppl goto, they click a game and enter run or whatever and it logs onto the server.
Will we need different ppl to be getting modules n stuff, shud i implement a standard one (default) but allow advanced server users to use an external module ?? (like a game mod)
It would be a server side thing. The server generates the ServerID, and sends it off. So, a server could implement it, but it would be transparent ont he client side.
Z.
LOL
I'm completely lost now.
When a server starts, it can specify a server ID generation module to load. The module would have the serverID generation class. The loader would load the module, and get the serverID generation object from the DLL, and use it transparently to generate IDs to send to clients. Only the server would need it.
Z.
OK, thats what i thought.
Well, Sas, I must say, good job with the site! I am exploring my web browsing capabilities with a Linux browser, and the site works pretty much perfectly. The only thing that doesnt work is the VBScript, but that doesnt seem to be a whole ton of the site (the site is still browsable =). So, good Job!
Z.
hey, im gonna be around for the next 3 hours, (till 10pm GMT) was wondering if NE one can do a test of the networking for me, just to see if all is working fine.
post if ya do.
Thanks, I'm just off to change that to Javascript now then. I'm not as comforatble with that I must admit!
:D
I've made the member page database driven now and am working on upgrading the forums' appearance. I will release it all eventually ;)
Um, it is javascript... :confused:
Well, maybe my browser just sucks =).
Z.
The servers can now be passworded. I have switched it so there is now two threads started for each connection (UDP and TCP).
The networking now has a callback funcion that allows the network/server/client to tell the application calling it when something happens.
hey,
i stuck together a little site for my mates and i who go skating with each other.
http://www.sk8-haven.tk
A few movies and pictures of us lot. Kinda not wonderful stuff though these are the only videos we have ever taken. Hopefully getting some newer better ones on soon.
Well, I just finished wrapping every function in debugging blocks. It looks like this:
If any unexpected error occurs, there is a try{}catch() block around the entire WinMain function. If an error occurs, I get a nice MessageBox that looks something like this:Code:RESULT StaticMesh::LoadMesh(char* filename)
{
Core::Function_Enter("StaticMesh::LoadMesh()");
// code goes here
Core::Function_Exit();
}
Nice easy stack tracing =). If you want, Psy, I can email you the DivCore module (just about everything uses it, though it is stand alone), so you can add similar tags around the Networking functions.Code:WinMain->TimesOfWar::Run()->Graphics::LoadStaticMesh()->StaticMesh::LoadMesh()
Z.
Cheers, u might as well.
Okay, I just remembered we had set a date for an Easter release which, at this rate, I don't think will happen. So, we may be able to do it by next weekend. Agreed?
We should have a building you can garrison in and a unit that can move around, etc, etc. I think that would be the best bet.
Everyone agree with this?
If you dont mind that the terrain is again a flat plane, I can get that done. If you want, I can even try to make the terrain wrap =).
Z.
Nah, lets not bother. I'd rather wait a while and release a really nice one than a worse one earlier.
Sorry, wud have replied earlier but was out at a sleep over party then skating.
I think we shud w8 until the terrain is better.
On my side of things. Zaei, how is the networking going to fit into the game ?? i can create a class to go into the engine that derrives another class form the network dll. Then i have a virtual function that passes back when things happen.
I kinda need to know how this is gonna work, shall i include a function in the class that goes into the engine like OnConnect() which u can add to change the display and let the user know its connected ?? (this OnConnect is then called when the client connects etc).
When is this game going to be done?
Not for a while. Were still working on the engine.
I was thinking that I would add a Networking object into the CEngine class, and then expose the functionality through the engine, and make descisions based on what the mod is doing (basically, making the mod keep track of its own state (ST_IN_CHAT, ST_LOADING, ST_PLAYING, etc.)). THis is what I amdoing with the other engine components. Let me know what your ideas are (specifically), and I will try to do it for you =).
Z.
ok, i have a class setup like this:
dn_network, dn_server and dn_client are in the networking module's dll file.Code:
dn_networking -> dn_network -> dn_server
-> dn_client
dn_networking will go into the engine. when the server gets a connection an OnConnect function is called and DN_SERVER is passed to it (so it knows form where the call is coming), the same also happens to the client but it has DN_CLIENT.
so when this call comes thru in the client u could have "Connected to server, logging in" then once a OnLobby is called u can say "Connected" then show the lobby. also there is OnPassword().
Here are all the calls (carried out via virtual functions):
Each client has its own state (as does each individual connection on the server):Code:
OnError() - An error in the system happened (anything from incorrect password to a problem in the actual network system (socket couldnt listen).
OnInitialize() - When a module is initialized (server/client) this is called and a session is passed.
OnTerminate() - When a module is terminated.
OnConnect() - When a connection is received or made by the client.
OnDisconnect() - When a client disconnects or the server receives a disconnection.
OnStart() // Server Only - When the server is listening
OnStop() // Server Only - When the server is stopped
OnPassword() // Client Only - When checking password.
OnUsername() //Client Only - When checking username.
OnLobby() // Client Only If Dedicated Server - When moving into lobby (allows ppl to chat).
OnGame() // Client Only If Dedicated Server - When moving into game state (actual game can be played).
Im not sure if any other states will be needed. The states can be accessed via a GetState function (client only).Code:
DN_STATE_NONE
DN_STATE_CONNECT
DN_STATE_VERSION
DN_STATE_USERNAME
DN_STATE_PASSWORD
DN_STATE_LOBBY
DN_STATE_GAME
DN_STATE_DISCONNECT
You may also have noticed the states and callback functions are fairly similar :D thats coz im thinking they will be called when state changes occur which could allow for the current state of the client to be stored in dn_networking / the engine (for easier access).
At the moment it is dedicated server only. I havent figured how im going to do non-dedicated.
hey Zaei. Im not a C++ genius and was wondering if u can quickly explain the try{}catch{} thing for error trapping for me. i think its best i use that or some system like it.
I dont have that class in my mail ox yet, i presuem it hasnt been sent.
Your setup looks good. When you are ready, just send it to me, and I will figure out how to hook it in =).
try{}catch(){} is pretty simple stuff =). Take this code snippet for example:
Imagine that there is a whole bunch of code in between thsoe lines, and each one depends on the others succeding. Now, imagine that the third allocation fails:Code:char* p = new char[10];
...
char* p2 = new char[10];
...
char* p3 = new char[10];
Now we have a 20 byte memory leak. Not good. One way that you can do cleanup is by using labels:Code:if(!p3) return;
Unfortunately, labels are, to say the least, frowned upon. But, there is a better way =):Code:if(!p3) goto exit;
...
exit:
if(p) delete [] p;
if(p2) delete [] p2;
if(p3) delete [] p3;
return;
new will throw an exception (thats what this all is, exception handling) if there is not enough memory. The above code handles that situation by delete ing any allocated memory.Code:try
{
char* p = new char[10];
...
char* p2 = new char[10];
...
char* p3 = new char[10];
}
catch(...) // using the ... is legal in code. It means that this block
// should catch ANY type of error. You can also do catch
// (int x), for instance, that only catches integers.
{
if(p) delete [] p;
if(p2) delete [] p2;
if(p3) delete [] p3;
}
There are also other ways to use it. Consider:
Simple enough. When this function is called, it just throws a simple exception. You can throw anything, by the way. It could be "throw 'c';", or "throw 10;", or whatever. Now, take the following:Code:void x()
{
throw;
}
Now, when function x() is called, the throw in that function is caught by the surrounding try{}catch(){} block, and the function continues.Code:try
{
x();
}
catch(...)
{
return;
}
That is about all there is to it =).
Z.
Okay, for the website this is when I plan to have things done.
Admin - Tuesday or Wednesday
Downloads (database driven) - Thursday
News (database driven) - Friday
Knowledge Base, FAQ, Artwork - Sunday or Next Monday
Forums - Next Friday
Admin - Next Sunday
Which means the site will be complete in 2 weeks. I think I can do this.... :rolleyes:
I finally got my head around what I am going to do with the terrain, and surprisingly its going to change about 20 lines of the code I already have =). Basically my problem was that, for my texturing solution to work, I have to overlap the tiles that form the terrain. At the moment, the only way I could do that was to have each tile aware of the other 9 tiles that it overlapped. Bad plan, huh? Well, I finally realized that the tiles were NOT the terrain itself, only the medium that I am representing the terrain with. So, the new plan is to have an external (mod defined) IHeightMap object which has a single (at the moment) function, GetHeight(). So, I have a pointer to this object in each of my tiles, and each one uses it to get a height for a vertex. This allows seamless overlapping tiles, which is the objective, and also solves the problem of somehow allowing access to all terrain data through a non-modifiable method (the terrain DLL).
To wrap that all up, the terrain tiles are no long the terrain itself, but instead a method of representing the terrain provided from an outside source (the mod =).
I will also end up with an ITileSet object, which will define the textures to be used on each tile =).
Z.
I still wish we had a VBR grid :D
eh?
Z.
You know, different levels of detail for different parts of the map. You explained to me why it wouldn't work and I agree, but still... :D
It is more of an amount of work thing. I think that it would be far to much work to implement, in terms of texturing and such, that it isnt worth it.
Ive got most of the changes I was talking about finished up, and am now implementing the texturing =). If someone could whip up a couple of images for me, it would be great. Id like, for now, a simple grass texture, a snow texture, and a rock texture. If someone is feeling very abitious, I could also use a dirt and a water texture =). Square, at a resolution of 256x256 or 512x512 each should be fine =).
Z.
Hey, I just realized something. Sometime in the next week or so is the one year anniversary of the original Divinity engine =).
Z.
I will be glad to oblige!
*Opens up Wally and rips a few textures from HalfLife.wad*
Here you go! :D:D;):rolleyes::eek::)
Here's the first:
The second:
And the third.
And, in about 1 month, it's the 1 year anniversary of the team coming together!
No, sorry, 12 days, it's Sunday, April 14th!
Thanks, Sas, exactly what I wanted =). I should have texturing up and running by tomorrow night (i cant wait to see it =).
Z.
Cool :D
Does the throw go at the end of the function or begining. didnt really get that bit. do u have a good link to a tutorial ?
Zaei, i need that class if u want be to implement this into the engine !!
No, I dont have a tutorial. I leanred by experience =). throw is a command that you can use anywhere to throw an exception. For instance, say that you have a vector class that you are implementing. When it comes to writing the code to do out of bounds checking, you might have a statement like this:
Say there are only 10 elements. What do you do? You could return 0, but that might not always work. The best way to handle this is with a throw:Code:x = v[11];
This will cause the program to crash(gracefully) if the index is ouit of bounds, which means there is a bug somewhere. throw can be used anywhere you like.Code:template<class t>
vector::operator[](int index)
{
if(index > m_size-1) throw "Index Out of Bounds!";
}
I will email you the class the next time I get on =).
Z.
Here to say I'm still alive. Sorry, my work has been going REALLY slow. To much **** to do. Aspecially with school, grade 12 is a *****. Gotta work hard to graduate :D
I am still working on things, just not as fast. Also, I'm waiting for my keyboard to come in so I can do some funky shizel with the music.
Well, as promised, the texturing works. As proof, here is a nice screen shot =). In essence, it is a tile engine:
http://www.vbforums.com/attachment.php?s=&postid=904837
Psy, I am going to email the Core module to you. It is the entire project, and it is a DLL, but you should be able to get up and running almost immediatly. If you have any questions, just ask =).
Z.