Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Karsten_

Member Since 19 Jul 2011
Offline Last Active Jun 28 2015 01:44 PM

#5101332 Best way to showcase a game made in Python/Pygame

Posted by Karsten_ on 14 October 2013 - 11:35 AM

A website with pictures, an embedded video and downloadable 32bit Windows exes or perhaps an Android APK* of the game is usually your best bet.
This also has the added benefit of letting your viewers get a local copy of your game to pass around so not having to worry about internet streaming which is quite a benefit (whereas many web games need internet or a small local html server (like mongoosehttpd) to be provided). Or even worse, they need horrible web plugins**!

With Python, you might want to use a packaging system since Python isn't very common on Windows machines for a typical user. If you can modify your install of python to be portable, then you might have some luck creating a self extracting .exe using WinRAR.

Emscripten (C/C++ to Javascript) compiler can compile a Python interpreter so depending on what dependencies your game uses, you might be able to get it running on a webpage too.

* Android is the most common tablet OS (rivaling even that of desktop systems) and seeing as you are not trying to sell your showcase game (at this point in time) your viewers can sideload it without the faff of developer certificates from something like iOS or Metro.

** I am looking at you, Unity web player! Though the developers are currently working on a WebGL javascript exporter using Emscripten.


#5100013 Multiplayer Extension?

Posted by Karsten_ on 09 October 2013 - 04:08 PM

They would need a good diagram tool and a telnet client ;)

Making an existing game multiplayer is very tricky to do properly. Much of the logic needs to be delegated to the server so that players cannot cheat by modifying the client.

Existing libraries that may make this process easier are things like Distributed Objects. http://www.aplaypowered.com/

<shamless_plug>
You might be interested in some of the ideas I presented in a paper at GAS2013(ICSE2013). It attempts to create a system to distribute local data in video games.
http://50.57.98.84:8080/doe2/icsews13gas-11-p-16814-preprint.pdf
</shameless_plug>

 

I find one thing that helps in a language is that cleanup is automatic but also deterministic (i.e in C++). This way, it is possible to send a message as soon as a local object is destroyed. There are many ways round this when using a garbage collected language but I prefer not having to think about this issue.




#5099212 C++ Pointer clean up question

Posted by Karsten_ on 06 October 2013 - 05:09 PM


...
if (pkObj ->id = id)
...

Did you perhaps mean to use == rather than =? (If this was just a quick demonstration example then nevermind ;))

 

Also, unless you know of a specific reason not to, you should look into using something like std::vector to create arrays in C++. It will help you against most (if not all) memory issues of this sort.

 

You might also want to consider using a std::vector of std::shared_ptr or std::unique_ptr if you don't want to worry about manual memory cleanup (almost critical if you use exceptions).

If you are new to smart pointers, start with std::shared_ptr so you dont need to worry about exclusive ownership and using std::move to push_back into a vector.




#5096171 Open world 3D game without a specific game engine

Posted by Karsten_ on 23 September 2013 - 09:49 AM

If I decide to use an existing engine, I do not need to learn the low-level stuff, maybe not even C++.

You will still need a programming language. C++ is as good as any.

 

What I suggest you do is evaluate some of your options. Dont worry if these are not the exact technologies you want to try. This is research at this stage.

 

Try building a simple cube platform jumper using the following tech.

 

1) Irrlicht - To try out a basic open-source 3D engine (use Ogre 3D if you prefer)

2) OpenGL - Have a look at implementing what you have just created in Irrlicht without using a graphics API directly (use DirectX if you prefer)

3) UDK - Try out a commercial engine (use Unity 3D if you prefer)

 

Once you have implemented all of them. Run them all and decide which one you have the most enthusiasm to extend and use to implement your next project.

 

:)




#5093567 Tile Map Editor/Collision Detection

Posted by Karsten_ on 12 September 2013 - 09:02 AM

If it is necessary, don't be afraid of creating your own tools. We have an internal tile editor but it certainly isn't in the same state as Tiled and is a long way off commercial tools. It is however more fit for purpose for our game than any of the others we had found. In other words, it would take longer to understand how the plugin system works for a 3rd party tool than it did to just knock together our own.
 
Here are a few of our tools. You can see how rough they are ;)

(One day we do aim to clean them up to release to allow modding for the actual game but polishing is pretty time consuming lol)

 

cdt.png

 

This map editor isn't actually tiling. Our days or tiling map editors ended once we realized none of us were very good at pixel art ;)

 

tdat.png

 

Both were coded in C++ and wxWidgets and it works on all our development platforms (something proprietary tools fail to do). All in all, it probably took about a day or two for each one but features were added as we needed them so I am not sure of total coding hours. Well worth it though because now we aren't relying on companies owning tools like Unity or Spine to stay in business or to keep up support of a feature smile.png




#5093021 Some Queries about game dev?

Posted by Karsten_ on 10 September 2013 - 08:57 AM

The term "engine" is perhaps a bit overused in game development. Typically it is just a collection of other separate libraries (i.e OpenGL, glm, OpenAL, SDL, libpng etc...) with a bit of glue code to hold it all together as a framework (often including extra things like a scripting layer, serialization, etc...).




#5092514 Stick with C++ or venture into C#?

Posted by Karsten_ on 08 September 2013 - 12:10 PM

A typical programmer will certainly need to know a few languages so it is always worth improving your knowledge of a language. I guess just try to avoid falling into the trap of always flittering between different languages and never specializing in any.

 

I only ever choose to use C++ (and it has paid off since I like to think I am pretty good at it now ;). However I still need to know C# so I can understand example algorithms that are written using it. I also need to know C# so I can implement glue code between Microsoft technologies.

 

For example, I also needed to know enough Java so I could kickstart my native C++ game on Android. I also needed to know enough Objective-C to kickstart the same game on iOS.

 

Programming languages are like cars. Once they crash and burn, you need to be able to move onto something else in order to get to your destination.




#5092031 sucking potata

Posted by Karsten_ on 06 September 2013 - 02:57 AM

Since C++ is on a much lower level Socket programming makes use of sockets implemented for each Operating System

Although C++ makes it easier than Java or .NET to work directly with low level C code, generally there is no reason that you should.

 

However as Khatharr mentioned, the sockets API on most platforms is very similar (Mainly because Winsock was designed based on BSD sockets a long time ago).

This combined with the fact that using the sockets API directly isn't that difficult (i.e not too much boilerplate code required to get quick results) so I probably suggest wrapping your own socket library. I could give you a link to loads of premade socket libraries but personally I dislike using other peoples wrappers for this kind of thing.

 

Below is a list of simple examples. I use these as a basis for my own netcode.

 

Winsock

Server - http://msdn.microsoft.com/en-us/library/windows/desktop/ms737593%28v=vs.85%29.aspx

Client - http://msdn.microsoft.com/en-us/library/windows/desktop/ms737591%28v=vs.85%29.aspx

 

POSIX / BSD / UNIX Sockets

Server - http://www.linuxhowtos.org/data/6/server.c

Client - http://www.linuxhowtos.org/data/6/client.c

 

Of course there is also Boost.Asio if you want to use a pseudo standard library (Akin to .NET and Java sockets).

 

For UDP, have a look at the simple examples here - en.wikipedia.org/wiki/Berkeley_sockets




#5090227 Confused about OpenGL 3.0+ shaders

Posted by Karsten_ on 29 August 2013 - 03:31 PM

From the looks of it, TheChubu based his answer off your sample code where you used vertexPosition_modelspace.

 

Try using in_Position instead because that is the correct name of the uniform.




#5090125 I Already Pick my Language and Now What i Need?

Posted by Karsten_ on 29 August 2013 - 09:52 AM

You seem to assume that he is using a Unix or Unix-like OS for that apt-get command.

That makes a nice change from assuming Windows and providing a link to the "setup.exe".

 

However, it does specifically assume a Debian based Linux distro (probably Ubuntu) as opposed to UNIX-like in general but it certainly is a start towards popularity of developing games on open-source platforms smile.png




#5089463 user input key store in array

Posted by Karsten_ on 27 August 2013 - 05:02 AM

Hopefully this will better explain what I mean smile.png

Input.h

class Input
{
...
  static std::vector<int> keys;
  static std::vector<int> upKeys;
  static std::vector<int> downKeys;
...
}

Application.cpp

    ....
    else if(event.type == SDL_KEYDOWN)
    {
      bool found = false;

      for(int i = 0; i < Input::keys.size(); i++)
      {
        if(Input::keys.at(i) == event.key.keysym.sym)
        {
          found = true;
          break;
        }
      }

      if(found == true)
      {
        // go onto the next SDL_Event
        continue;
      }
 
      Input::keys.push_back(event.key.keysym.sym);
      Input::downKeys.push_back(event.key.keysym.sym);
    }
    else if(event.type == SDL_KEYUP)
    {
      for(int i = 0; i < Input::keys.size(); i++)
      {
        if(Input::keys.at(i) == event.key.keysym.sym)
        {
          Input::keys.erase(Input::keys.begin() + i);
          i--;
        }
      }
 
      Input::upKeys.push_back(event.key.keysym.sym);
    }
    ...

from https://github.com/osen/mutiny/blob/master/src/mutiny/Application.cpp




#5088632 Should I make a sacrifice?

Posted by Karsten_ on 24 August 2013 - 03:51 AM

Unity is working on a WebGL exporter which one day will be as ubiquitous as HTML5 (yes, even the latest IE is beginning to support it ;)) so your projects in Unity will work in standard browsers without plugins (probably by the time you have finished it).

 

Another option is to use the open-source tool which even Unity is using to make this possible, Emscripten allows you to write in standard C and C++ and output to HTML5 (via the wrapped SDL library) or WebGL (via the inbuilt OpenGLES 2 support).

 

If you want to stick with Javascript (rather than C++ or .NET/UnityScript) then have a look at three.js. This is apparently quite a popular engine.

Even Microsoft is suggesting it in their preliminary WebGL docs (http://msdn.microsoft.com/en-us/library/ie/bg182648%28v=vs.85%29.aspx).

 

I think where you might be hitting a wall is trying to use technologies like CSS. This type of web tech does not offer enough flexibility for pseudo realtime games (I personally also find it completely defective for normal web pages too). So I suggest looking at "coding" languages as opposed to markup (layout) languages.

 

But yes, I also believe games are going the direction of the web. If only because it allows publishers to "lend" the game to a player rather than allowing them to keep a copy (i.e DRM).

Most tablets are also so locked down and crap, that people can only really use them for the web browser anyway, so games on the "web browser" platform are more convenient for potential players.




#5087537 Creating My First Large Scale RPG

Posted by Karsten_ on 20 August 2013 - 04:11 AM

Especially when the article you linked clearly states that C++ does not have a garbage collector, as opposed to Java which does.

Yep, which I agree with. C++ does automatic memory management without requiring a garbage collector.
 
You can strap a garbage collector onto C, however I wouldn't say the C programming language has automatic memory management. Yet this is exactly what people seem to do with Java.


#5087410 Creating My First Large Scale RPG

Posted by Karsten_ on 19 August 2013 - 04:37 PM

Java seems easier to learn (e.g. due to automatic memory mgmt)

 

C++ has automatic memory management. Java doesn't, that's why it requires a garbage collector.

 

http://duncan.mac-vicar.com/2012/08/01/c-does-have-automatic-memory-management/

 

 

Either language, C++ or Java should easily be capable of a 2D RPG. Both should work great on desktop computers and Android. However if you want it to run on iOS too, I have yet to find a decent Java solution for iOS, in which case C++ might be the better option.

 

C++/SDL/OpenGL and Java/OpenGL(JOGL) are some examples of the libraries you could use.




#5086495 Do you find C#'s lack of an explicit destructor to be an issue?

Posted by Karsten_ on 16 August 2013 - 09:51 AM

need to implement and call the necessary methods yourself anyway. So no, I don't really see any issue there.

In languages with RAII and "other" solutions to memory management (such as C++ or Objective-C), you indeed need to implement the specialized cleanup code (as you would in C# / Java) (such as send disconnect messages, stop thread etc...) however, you don't need to call the methods yourself. This is extremely important for me because if an exception has been thrown, then in many cases the manual calling of the cleanup code you would need to do in C#, would not be called.

// Pseudo-code/C#: The IDisposable pattern has too much boilerplate for me to be bothered.
MyThread mythread;
 
Constructor()
{
  myThread = new MyThread();
  // oops an exception is thrown
}
 
~Finalizer()
{
  if(myThread != null) { myThread.Destroy(); }
}

void Dispose()
{
  if(myThread != null) { myThread.Destroy(); }
}

The finalizer or Dispose function for a class that never completed its constructor will never be called. You now have a Memory / Resource leak

 

In C++, the thread started by start thread would be destroyed (as the thread object pops off the stack), however in C#, this is made even worse by the fact that the garbage collector will never cleanup the thread because even though it has no reference left, it still has a unit of execution running on it (i.e itself).

 

Again, this can be solved elegantly using either RAII in native C++ or auto_handle in managed C++/CLR

 

In C# or Java, the solution might be something like this (which I personally dont like)

Constructor()
{
  try
  {
    myThread = new MyThread();
    // oops an exception is thrown
  }
  catch(Exception)
  {
    Dispose();
    throw;
  }
}

Ironically when I use Java and C#, I find myself writing more cleanup code than C++ (which admittedly requires none unless you use low-level C libraries (as you would also need to in C#/Java).






PARTNERS