Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Jul 2011
Offline Last Active Yesterday, 03:21 AM

#5312991 Why do most people recommend Python

Posted by on 28 September 2016 - 03:51 AM

So it looks like you have decided on C++ in the end. A good choice and frankly, my only choice (due to lifespan, support and availability).


However, I can't help but feel that you arrived at this conclusion in the wrong manner. You really need to evaluate for yourself what works rather than be told. Otherwise your next hurdle will be just as difficult for you (OpenGL, DirectX?).


Also... I don't know the best way to tell you this but "the game industry" is unlikely to have written you an email. It cannot write emails since it is not a single entity. It also has no hands making it very hard for it to write emails.


So "Mr Game Industry" (or Jason as in your other post), looks to be responding with a bias that you are entering game programming as a career. This has a massive impact on what choices you make. It means you will be working in large teams and with existing (sometimes legacy) codebases making C++ the obvious choice. Basically indie developers might well choose something else (and Python is still a very valid choice here) so still evaluate and choose for yourself!


... or if you do want to be a professional game developer. Learning them all is the only reasonable option.

#5311875 Why do most people recommend Python

Posted by on 22 September 2016 - 04:43 AM

Although I have only played with swift, it looks quite pleasant to use. However as a developer it is always required that you look outside the language to see what libraries are available, what platforms it can be used for and what is the future feasibility of it. I can try to answer these:


1) It only really has libraries available to it on Apple's Cocoa platform. I.e otherwise you are going to be spending most of your time writing binding layers for every platform you use it on. For example bindings would need to be written for it to use OpenGL or SDL on the Linux platform.


2) It is cross platform because it uses LLVM as its underlying technology but there is very little support on non Apple platforms. IBM was looking at getting it running on some of its enterprise operating systems but lets be honest, we wont be writing games to target them ;)


3) Lifespan... Nothing from Apple really has the best lifespan but it does look like they are committed to Swift. That said they are not going to be rewriting the OS to use Swift rather than Objective-C so you might want to stick with the latter instead. (You can also use SDL and OpenGL directly from Objective-C on non-Apple platforms ;)).


So sometimes it isn't about how easy the language is. It is about how useful the technology (and legacy) behind the language is. Otherwise, lets be honest, C would not be second from the top on the IEEE and TIOBE language stats ;).




#5310160 Advice on engine to use

Posted by on 09 September 2016 - 02:32 PM

Stardew Valley looks like a kinda neat harvest moon clone :)


Since you are looking to do a 2D game, you will find that you don't really need an engine as such. So Cocos2D is pretty good. I personally would go slightly lower level towards SDL for slightly more portability but this is a non issue at this point (and it is C not C++).


Another one you might want to look at is SFML which is not an engine but a framework and provides very similar functionality to Cocos2D.

#5309316 Want to Learn how to Start Coding to make video games

Posted by on 03 September 2016 - 11:41 AM

The topic title specifically said C++. Why does everyone jump to suggesting the Unity product? This product can't even use C++ for its scripting.


I would suggest keeping with C++ which will certainly better serve you in the long run as a proper programmer.


I also suggest using the SDL library to start with 2D games until you are ready for 3D, in which case Unreal Engine 4 is a more powerful engine than Unity and 100% free and has the source available.


Also Unity (even the free version) has a one time subscription / DRM sign in system (personally... sod that!).

#5308997 Need a very simple collision detection for walls. ( 3d )

Posted by on 01 September 2016 - 07:39 AM

Can you not just test collision between a box (your player) and triangles (your wall meshes).

I tend to use the fast triangle-box overlap test from Tomas Moller for things like this.


There are other fast intersect tests here too such as tri-tri and ray-triangle.


#5308993 Python or GML?

Posted by on 01 September 2016 - 06:55 AM

The reason why you are finding it hard to take a GML course is because GML isn't really a proper programming language. It is a domain specific scripting language for a (effectively consumer) product.

You are much better off learning Python and if (like me) you don't like learning multiple things at once, then make Python take priority! Python will be around 10 years from now, GML won't (or will be very different) so this alone makes it more worth while.

Now, on to Python. Graphics, audio, input, everything is very posible in Python when using a library such as pygame (http://www.pygame.org). Honestly it doesn't really get easier than this so I cannot imagine what GML brings to the table that would ever make it a more viable choice.

That said, it doesn't get much easier than pygame but that doesn't make it easy ;), just keep learning and stick with it and most of all, enjoy it.

Hope this helps :)

#5307249 Is it inefficient to use Unity to turn 32kb of Javascript into a mobile app?...

Posted by on 22 August 2016 - 12:13 PM

They may not really need everything that std::string provides, but you may as well have it.


Hmm, its closer to pointing people towards Qt, just to use QString to concatinate two char* together ;)


But yes, I see your point but I still do see too many Javascript developers dragging in JQuery for very trivial things.

#5307213 Is it inefficient to use Unity to turn 32kb of Javascript into a mobile app?...

Posted by on 22 August 2016 - 09:57 AM

Followup Question: Is using a massive library for a single function also inefficient?  (I suspect it's a different process than what's going in with Unity.)


Personally I feel that dragging in a library just for a single function is a bad decision overall. It is not elegant and often causes problems with maintanance later on.


However... I must be wrong on this because I see so many Javascript developers drag in all sorts of crazy dependencies for doing extremely simple tasks. I am sure you have already seen the word "JQuery" pop up many many times on help forums. Always, without fail just to split a string, some weirdo will suggest JQuery.


But that said, I am in the fortunate position of being able to avoid working with developers such as these ;)



It reminds me of the time when someone dragged in the GLM maths library into our database project just to use the vec3 length function. The compiler we had on our build server didn't support such an old version of GLM and so when it came out why he had done this, It certainly didn't inspire much confidence in any of his later decisions. I think he later went on to use glm again, just for glm::detail::tvec1<T> or something just to zero initialize member variables... I did chuckle ;)

#5306997 Is it inefficient to use Unity to turn 32kb of Javascript into a mobile app?...

Posted by on 21 August 2016 - 04:18 AM

I personally don't like Unity, I find it time consuming and messy compared to other solutions but I know it has a lot of marketing behind it and many of my students do seem to like it.


Perhaps just be aware that Javascript in Unity (actually called Unityscript) and Javascript for web browsers are very different. So you might have to end up recoding quite a lot of your work if it is already standard Javascript.


You can make an app that just surrounds a web browser and run your game in that, it would work. I don't know what the components are called but you can pretty much just drag and drop it in using the visual designers.


Edit: What unity does for web exporting is convert its compiled .NET code (Unityscript/C# etc...) to C++ with il2cpp then it uses Mozilla's free and open-source transpiler to compile the c++ to very low level Javascript (asm.js). This is faster than normal javascript because it can be optimized well (although isnt very human friendly to develop with directly). The output binaries are very large because Unity, as an off the shelf product provides a lot of things even if you dont use them and doesn't strip out everything you dont need.

#5306875 Implementing PvP for a simple, non-trivial, javascript mobile game app

Posted by on 20 August 2016 - 08:19 AM

HTML5, or more specifically WebSockets does not allow a client web browser to host a server so regardless of if using Emscripten (via Unreal or Unity) or directly writing Javascript, it cannot work. You will need a server somewhere that can act as the game server for all your clients to connect to.


If you are interested in writing an app for phones or tablets, then these can of course host the server.


However, a slight hack you might be able to get away with if your game does not require much bandwidth to play: Use free Internet Relay Chat (IRC) servers to act as the "game server". Some of these support WebSockets or provide websockify proxies so that Web browser javascript can connect.


IRC such as irc.blitzed.org or freenode employ anti flood protection and limit clients to about 30 messages a minute. So if your game can get away with this, then it could work for you. I actually use this technique as a cheap and dirty list server for my multiplayer games.


If you need to scale up and host your own IRC servers one day (and remove the message cap) IRC is a standard (albeit pretty ancient though still popular) and you can find loads of very robust and tested open-source IRC servers.


As a rule of thumb, if your game is 2D, just plain Javascript and HTML5 canvas are often the easiest development platforms. If it is 3D then perhaps look at using an engine or perhaps Three.js (WebGL is a little too time consuming to use directly for most games). As for a database, then you are going to need a server anyway, perhaps use a RESTful type API in PHP and then SQLite? Loads of similar solutions here.

#5305911 Handling concurrent random access of shared resource on peer to peer system?

Posted by on 15 August 2016 - 03:17 AM

Right, I have uploaded the paper. It is actually one of my short papers (which I always find very difficult to fit enough information in) but hopefully it might give you some starting point.




Just waiting on permission to release source code. The problem is that the project utilizing this code has been Greenlit on Steam but we haven't been bothered to do anything about it haha.

#5305619 Handling concurrent random access of shared resource on peer to peer system?

Posted by on 13 August 2016 - 04:39 AM



As SeanMiddleditch suggested, you cannot lock resources on other computers directly. However you can create an API which makes it appear as though you have (which is how network filesystems such as NFS, SMB etc... work).


I wrote a paper a while back on how to provide and sync a tree-like structure to all clients and allow them to share / lock the resources in a multi-player shooter game. You might find it useful: http://dl.acm.org/citation.cfm?id=2662601


If you are working with C++, I might be able to rip the source out of our existing product and share some things.

This stuff is also still very relevant to my PhD so I would be very interested in hearing if you have come up with any of your own nifty solutions to this.


Edit: Darn, just noticed that the ACM Digital Library is not open-access and is only accessible behind a University address range or for paid subscribers. I will grab the .pdf paper and upload it on Monday. Sorry!

#5303532 Virtual Machines

Posted by on 01 August 2016 - 01:24 PM

You can use Virtual Machines to get OpenGL 3.0 since LLVMpipe on most modern Linux distributions provides a software renderer advertising OpenGL 3.0 compliance. Unfortunately it does not go higher yet to 4.x.

It's also quite slow (though surprisingly not too bad) and only really useful for certain testing.

#5303202 Compilers

Posted by on 30 July 2016 - 10:02 AM

Since much of the world is still using Windows 7, if you *must* use Visual Studio, I recommend 2010 (2010 express if you don't want to pay). That way your beta testers / friends do not need to download and install extra runtimes just to give feedback on your software.


Personally I recommend getting away from Visual Studio since I have seen so many developers get locked into it and missing out on really cool innovative compilers like Emscripten. So perhaps give GCC a shot (via the MinGW distribution) or better yet, Clang (since there is so much great work done on this tool these days). As a bonus, you do not need to install runtimes to get the output working on other machines (single portable .dll instead).


Some IDEs you might like if you want something more than a text editor:






These can all be made to use Clang, GCC, Emscripten etc...


But... remember, a lot of professional software developers do not use IDEs, perhaps have a think as to why and decide if you really need one. You will be so much more dynamic if you can make do without.


I personally use vi on OpenBSD and Notepad++ on Windows. Both help me keep my sanity and also allow me to clearly see where Visual Studio has fscked up the formatting when I mark my student's assignments.


Also Visual Studio 2015 Community requires logging in before you can use it. I never trust this kind of stuff.

#5297428 Microsoft Checked C

Posted by on 21 June 2016 - 03:57 AM

Just thought I would explain my interest in Checked C a little bit more. I am not here to recommend writing a game in it, I am suggesting that this could be a great technology to use for the parts of software that are currently needing to be written in ANSI C. For example things like SDL, Mesa, glew, glut, compilers etc...

No matter how much we (effectively the consumers in this context) prefer our own different languages, sooner or later we all depend on a C library that could potentially be made safer by using Checked C.

So things like Rust a C++ would still potentially benefit from Checked C. And that I think is pretty cool.

Rust is written in ~1.6% C (which is a massive amount of code, larger than many games in fact)
The Clang compiler is written in ~21.6% C (again massive and that's forgetting the standard library wrapping a lot of C)

If Checked C can alert us to bugs in these projects, then everyone's a winner :)