Jump to content
  • entries
    943
  • comments
    5,899
  • views
    923,763

Week 3


Josh

2,893 views

 Share

The last two weeks were mostly me wrestling with C++. I had promising results with a meta language that translates to C++ and compiles, and also learned how to create makefiles as a result of that. I tried CodeLite and CodeBlocks, in addition to MS Visual Studio. I finally settled on CodeBlocks.

 

Codeblocks can be configured pretty easily to use GCC, the MS C++ compiler that Visual Studio uses, as well as about a dozen others (very curious to see if LE3 compiled with the Intel compiler is faster!) I prefer GCC with no optimizations for development, because it builds about twice as fast as the MS C++ compiler. Although I find Scintilla to be slow and somewhat poorly written, it's nice to have a cross-platform code editor. I can also configure Codeblocks to stop on the first error (it's actually a GCC compiler setting) and it automatically opens the file and selects the line the first error occurs on (CodeLite does not). Because I realistically expect to make thousands of coding errors during the production of LE3, it makes sense to streamline this highly repetitive task any way possible, and for that reason Codeblocks wins.

 

The meta language made a promising start, and I may offer it as a product in the future, but it will not be used to develop Leadwerks 3.

 

I've started on the OpenGL4 renderer. First I create the base renderer class, and established what the commands would actually do. Next I am going to create a window in Windows, set the pixel format, and initialize an OpenGL context. I've done all of these tasks from scratch in BlitzMax, but it's been a long time since I dealt with any of that.

 

One of the most confusing parts for me was pointers versus references. In C++, pointers act pretty much like an object in Blitz3D: When you declare the variable, it's null, you create a new object and assign the variable to it, you delete the object manually when you are done with it. Now if you declare a variable that is a class, it creates it instantly and it can never be Null; it just exists. When the variable goes out of scope, it gets deleted/destructed automatically. This was pretty confusing until I realized that these objects are just like when you declare a float or integer variable. You don't worry about cleaning it up, because it only exists within the scope of the function it's declared in. You can never set an integer to Null, because it just exists; it doesn't get deleted. In the same way, a Vec3 variable doesn't need to be cleaned up or deleted; it just exists within the scope it is declared in. Therefore, it makes perfect sense for math classes like Vec3, Vec4, Mat4, etc. to always be used as a regular variable, and for complex objects like entities, materials, etc., to always be declared as pointers.

 

I had another look at the Android SDK, and decided an Android game development would come in the form of a static lib for use with Java (or pure C++ if you prefer and can set it up). I'm cautious about the iPhone, but because Leadwerks is a code-centric development approach, I don't think we will have much trouble staying in compliance with the Apple EULA. I sort of understand Apple's strictness. I love my HTC Evo, but there's so much on it that just doesn't work. The app store is full of horrible crappy games. The App Installer even crashes on startup. iPhone gets Doom 3 by id Software, and Android gets 10 versions of Doom classic compiled by some kid, and none of them work. :blink: If Apple can deliver a good and consistent user experience, then I don't really have any problem with the restrictions they give developers.

 

You can now add your SteamID to your Werkspace profile and display your Steam status. It may help a few people to join up for some fun multiplayer challenges, but I am mostly interested in learning about the multiplayer features Valve has implemented in Steam. Join the Leadwerks Developer Steam Group and be sure to keep a couple games in your wishlist. ;) Thanks to HurrBeDragns for reserving the URL for me!

 

I want strong multiplayer support in LE3, and I like some of the things Valve has done. In LE3, all entities can be saved to a binary file format. We have learned how troublesome serialization can be, so we won't be using that, but this binary file format can be used for prefabs, and even for syncing entities over the network. I've already had success specifying an entity should be synced over a network. It's really nice to have everything just work automatically. I'm in favor of just letting the server handle all interaction, with no client-side prediction because: 1. client-side prediction is inaccurate and wrong, 2. It was originally designed for 56k modems, and 3. Onlive has proven that player response lag can be minimal even when streaming graphics in real-time. The design I used in the multiplayer tests I conducted a few month ago was certainly good, and the results were responsive enough as long as the players were on the same continent.

 

The platforms I am most interested in are Windows and MacOS, now that the new iMacs are shipping with decent graphics cards. The GPUs the new iMacs come with range from an ATI Radeon 4670 up to a Radeon 5750. By following the ATI/NVidia rule and dividing the number of ATI stream processors by 5, we can deduce these cards to be the equivalent from about an NVidia GEForce 8600, to a bit better than a GEForce 9800 GTX. This is definitely within the range of Leadwerks hardware requirements, so I look forward to developing for MacOS in the near future. And it's a good excuse for me to get a 27" iMac. :D I did not like the direction Microsoft went with Windows 7, and the new OS has finally put me in a place where I am willing to try something new. That never would have been this case in the days of Windows XP. Just so you know I am not turning into a total Apple fanboy, it is funny they make a big deal out of having a separate graphics processor...I had a 3DFX card in 1997, and they are only now catching onto the idea of dedicated GPUs! :D

 

That's pretty much it for now. Stop on by the Asset Store and grab the Industrial Cargo Model Pack for only $9.95 before the price goes up tomorrow.

 Share

7 Comments


Recommended Comments

One of the most confusing parts for me was pointers versus references. In C++, pointers act pretty much like an object in Blitz3D

 

When I realised that about a year suddenly pointer made sense. I saw that everything in Blitz3D was just a number. Armed with that new knowledge

 

1. client-side prediction is inaccurate and wrong, 2. It was originally designed for 56k modems

 

But still when the server has a large number of entities to track it starts to fall over. I'm generally of the opinion that clients are always dishonest and the server should authoritatively do as much as it can, there are some things that you have to offload to clients, debris for example.

 

Whilst we have a much higher data rate than we did 10 years ago, we also expect our games to handle a much larger load than they did at that time. One of my brothers' final year uni project was to build a small multiplayer game in Blitz 3D. Although he promised client side prediction, it wasn't there for the final submission. On a local subnet it was fine, and this was still so when played on the wider local network. As soon as it hit the Internet you could see occasional stutters.

 

That told us that a relatively high end home connection (20 megabit cable) connecting to a server on the SuperJanet network still needed a little bit of prediction to make it as smooth as it was on lans. And If you're wondering, SuperJanet has a throughput rate of about 40 gigabits per second, it's certainly one of the fastest private networks in this country, if not one of the fastest world. I'm sure there are some that handle terabits per second, but no one here is going to get their game hosted on one. But that certainly make me wonder about no prediction coupled with the much lower throughput rate of most dedicated server providers.

 

I did not like the direction Microsoft went with Windows 7, and the new OS has finally put me in a place where I am willing to try something new.

 

Oh come on Josh, you there was another option... :)

I can see why you might be annoyed having paid so much for 7 Ultimate...

...But paying even more for a mac is not the way :)

Link to comment

I'm still not sure why you are giving up BlitzMax for C++, as you are productive enough in it, to be a threat to the bigger engine makers. :)

 

If it is for cross platform compatibility, I guess it is a good enough reason. If it is for something else, I don't get it.

Link to comment

I'm in favor of just letting the server handle all interaction, with no client-side prediction because: 1. client-side prediction is inaccurate and wrong, 2. It was originally designed for 56k modems, and 3. Onlive has proven that player response lag can be minimal even when streaming graphics in real-time. The design I used in the multiplayer tests I conducted a few month ago was certainly good, and the results were responsive enough as long as the players were on the same continent.

 

I have to agree with mumbles on this. Client side prediction is still a must have for multiplayer games, and ignoring that for the only reason I can see is because it's complicated to do correctly is a big mistake and will make the netcode a joke in the engine community.

 

There are a few reasons it works for OnLive: 1) They have many "hubs" around the US. 2) They are only offering this in major cities. 3) They have special logic built in to control where their hops go.

 

Networking is easy, but networking correctly is complicated. If you are serious about adding networking functionality that is really usable then you would hire someone who knows how it's supposed to work.

Link to comment

We wouldn't leave home without cubic spline interpolation, between Bangkok and the UK we couldn't. In the real wold outside the US and cosy net services the internet weather can be a little rough. We send more data than just positional, since our entities don't make sudden changes positional updates can rely on client prediction between those updates to allow state data through which potentially can change faster.

 

It's your opinion of course, I've had time with commercial sims like Empire Interactive's Apache Havoc and the networking was a disaster. Assumptions on letting the transport layer handling problems is just doomed to failure leading to complaints about performance. Nobody will end up using it.

Link to comment

Client prediction is a must, although I don't know if it's up to the engine to handle it. I would surely like it though.

Link to comment

You send UDP messages with the "reliable" flag disabled, and add a counter to each one. When the client receives the messages, they discard any that have a lower counter than the last received update. We actually saw 100% smooth and accurate physics over the network, something that I've never seen before. Compare that to any game using the Source engine, where the physics are constantly stuttering and bouncing around.

 

Maybe we will implement a cubic spline prediction for physics bodies, but it needs to be silent, automatic, and in the background.

 

I'm still not sure why you are giving up BlitzMax for C++, as you are productive enough in it, to be a threat to the bigger engine makers.

I can't sell BlitzMax source code to professional studios, and BlitzMax won't run on the XBox or PS3. I've had a number of offers to buy source licenses if the code were C++.

 

Oh come on Josh, you there was another option...

Linux is only free if your time is worth nothing. :)

Link to comment

"Linux is only free if your time is worth nothing." hehe I like that. I suppose like most things, if you're skilled in it it's second nature but made me chuckle though.

 

I just want to add that I love seeing a Roadmap. Streaming terrain and is something we started to look at using GROME as an editor, it has powerful scripting features and the ability to slice up huge maps. But of course it's breaking LE in two which is fine, cherry picking is part of creation process. The prospect of staying 'native' is quite appealing.

Link to comment
Guest
Add a comment...

×   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.

×
×
  • Create New...