Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Oct 1999
Offline Last Active Aug 28 2016 08:17 PM

#5303303 Virtual Machines

Posted by on 31 July 2016 - 05:33 AM

Are you sure your card only supports OGL 2.1? Did you actually tell SDL to create a modern context?

#5297231 Whats the difference between static, inferred and dynamic types

Posted by on 19 June 2016 - 12:09 PM

Static types are fixed. Variables are declared as specific types and their types don't change. 

// x is forever an int
int x;

Dynamic types need not be declared and the type can change. Variables can be initialized with one type and later assigned a different one.

// x is an integer type of some kind
var x = 10;

// Now it's a string type
x = 'ten'

Type inference occurs when no type is specified and the compiler determines what the type should be based on the type of the initializer. The dynamic type example I show above uses type inference for both the initialization and the assignment. C++ and D also support it.

// In this D code, x is inferred to be an int and y a float,
// but they are still statically typed (i.e. the types can't be changed)
auto x = 10;
const y = 20.0f;

#5296215 what was the first video game?

Posted by on 12 June 2016 - 07:41 AM

I've always heard Steve Russel's Spacewar! given credit as the first video game. It wasn't the first one ever made, but it was the first one non-researchers could get their hands on.

#5293579 Can I write a browser game only using Java?

Posted by on 26 May 2016 - 07:54 AM

Yes you can, using the built in Java Applet


 Please note that a lot of folks do not have Java enabled in their web browser.


I strongly advise against this. Java Applets are a huge security hole, not to mention the negative reputation they have. Much better just to go with LibGDX. Code everything in Java and deploy to HTML5/JS, Android, iOS, PC, Mac, Linux and who knows what else.

#5289588 Does server's location affect players' ping?

Posted by on 01 May 2016 - 10:56 AM

I live in Seoul, Korea and totally love the availability of high speed internet here. The government subsidized its development starting in the late 90s and it has really paid off. Gigabit internet nearly everywhere these days. If you play any local online game, your ping times are as low as they can go. Download massive files from anywhere in the world in a blink. But play online games on European servers and you've got some serious latency. I play Elder Scrolls Online fairly frequently. With their North American server I get between 180 - 220 ms pings. With their European server it's consistently 300+. If you want to keep global players at 60ms pings, establishing regional servers is the only option.

#5288263 Is there an official list of all registered game titles out there?

Posted by on 23 April 2016 - 03:40 AM

And, FYI, if you're worried about violating a trademark, you can search the U.S. trademark database here: http://tess2.uspto.gov/bin/gate.exe?f=tess&state=4802:d8girm.1.1. Other governments may have similar sites.

#5288262 Is there an official list of all registered game titles out there?

Posted by on 23 April 2016 - 03:37 AM

There's no such thing as a "registered" title. There are trademarked names for some franchises (e.g. Madden, Tetris), but most game titles are not trademarked. Unless you are making a game that looks identical to another and using the same exact name for it, it's something you generally don't need to worry about. Particularly for a hobby game.

#5287767 OpenGL (Game) Engine

Posted by on 20 April 2016 - 07:41 AM


Pick a simple game to create. Just building an engine is nebulous. I've done it before, and I just ended up working on cool features that never actually get used. Feature creep was particularly bad. You can definitely still create the engine, but just view it as reusable code for your game projects. You could make a game as simple as 3d pong.

GLFW is its own window and input manager. You will either have to pick one or the other. If you want to go with Qt then this might be useful


Thanks, i completely understand what your saying and i agree, but you didnt really answer most of my questions about the libraries. 


That post actually does answer your questions about GLFW -- "GLFW is its own window and input manager." It does provide an API to get the native window handle which you might be able to use to embed the window in some frameworks, but GLFW is primarily intended to create the main window of your application, i.e. if you're using GLFW, you aren't using QT or anything else. That's why I recommend you avoid it in the engine code.

#5279780 Creating a Text Adventure Game

Posted by on 06 March 2016 - 12:19 AM

One of the old MU* (MUD/MUSH/MOO) techniques is to use zones for this sort of thing. Divide the world up into zones, then divide each zone up into rooms. Each zone can be as large or small as you need it to be. You might have one zone represent a city, then next to it a zone representing a stretch of wilderness, then another zone next to it for another city, and so on. You might also have smaller zones to represent dungeons or towers inside a city, caves in the wilderness, and whatever. Each zone has entrances and exits like a room. In essence, it's a room that can contain other rooms, though how far you want to take that (should zones have descriptions? should zones have special features that rooms don't have?) depends on the nature of the gameplay.

#5274262 Array in constant buffer

Posted by on 04 February 2016 - 09:48 AM

God, everyone says post source code, then when I spend hours putting something together that I can post and actually do, I hear no more responses.  What happened?

That was just standard advice to make it more likely that someone would be able to help you, not a guarantee. Always keep in mind that there are a number of people coming here from different timezones around the world, with varying skill sets. It sometimes may take a while before someone with the ability to recognize your problem comes along, if at all. Some problems are easier to solve than others, but posting source is a minimal first step.

#5271370 Why does MSVC warn that "not all control path returns a value" with e...

Posted by on 15 January 2016 - 08:36 PM

In D, you can use a final switch with an enum. This will cause the compiler to error out if you don't have a case for every member and won't let you use runtime-initialized values. It's very handy. It would be great to see something like that in C++.

#5265820 Cross Platforming: Switching to Java?

Posted by on 10 December 2015 - 08:50 PM

Josh Petrie's advice about testing is spot on. It certainly is much easier to deploy Java across multiple platforms these days. Libraries like LibGDX make it a painless process. Low-level bindings like LWJGL ship with all of the binaries they need on each platform. You only need to compile on one platform and the world is your oyster. Still, it's possible for platform-specific bugs to pop up in those low-level libraries, and they do from time to time. So you should always test on every platform to which you plan to deploy.

That said, there's a cost-benefit issue here. Is the benefit of using Java greater than the cost of abandoning your current implementation and starting over in Java? From what you describe, the answer is most likely "no." There are other factors to consider besides deployment, such as productivity in an unfamiliar language. You are using cross-platform libraries anyway, and that greatly reduces the amount of work you need to do for multiplatform in C++.

So, a) since you're already rather far along in the project, b) apparently the only problem you're trying to solve is to avoid compiling and packaging on multiple platforms and c) you ought to have those platforms available for testing even when using Java, then I would advise you to stay your current course.

#5265817 Loading an image saved at runtime

Posted by on 10 December 2015 - 08:29 PM

It may still boil down to the fact that maybe it is not possible to save and load to program in the same runtime (same executable runtime), or is it?

Please just throw this idea away and never let it return to your head. It has always been, and will always be, possible for Java programs to save and load the same image as many times as you would like during the same execution of a program. This is not your problem.

No matter which programming language you use to write a program, always, always, always check return values. Never assume that something working today will work tomorrow. When a return value isn't want it should be, log it and react accordingly. Logging it is the most important thing here. It will help you narrow down the source of most problems more quickly.

#5256947 Game development with assembly. Where to start?

Posted by on 12 October 2015 - 07:15 PM

You might also want to browse through this series. It's quite old (I can't believe it's been 16 years! I didn't expect it would still be online), but it should still be full of useful info.

#5256946 Game development with assembly. Where to start?

Posted by on 12 October 2015 - 07:10 PM

You use the same APIs you would use from C or C++. You'll need to properly prototype the functions you want to call, then call them according to their calling convention. There are some simple examples at this page.