Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 31 Oct 2011
Offline Last Active Dec 26 2014 06:40 AM

Topics I've Started

Making a Form that doesn't freeze from Console Application

01 October 2014 - 10:15 AM



I have a console application that runs an 'infinite' main loop. Now I want to add a Form to it to serve as GUI. 

My problem is, that if I run the Form first, and then start the main loop, it never reaches the main loop until the Form is closed because it freezes the thread.

If I do it the other way around, it never reaches the part where I run the form of course.


I've tried some other things, like using Form.Show() and then enter the main loop. But even though the form appears and the main loop works, the form becomes unresponsive.


Does anybody know another way to do this? I've tried some multithreading, but I can't seem to make communication between the Console app and the Form.


Thanks in advance,


3D Graphics with C#

23 August 2014 - 09:50 AM



I want to make a game with simple 3D Graphics in C#. With simple I mean that the graphics will only cosist of basic shapes with a texture and that I don't need to load models, nor do I need fancy effects.


I have made 2d games with C# before using the built-in Graphics class. I've also made 3D games with Java and OpenGL (With the LWJGL).


Now my question is: What kind of library should I use?


I'm not sure if I want to use OpenGL or DirectX. DirectX seems to be the most commonly used with C# but I happen to have experience with OpenGL so that might be a good choise too.


I'd like it to be easy to set-up, and not way too difficult to use. I've found a tutorial series for OpenGL and C# where you had to write your own shaders, and that's not what I'm planning to do. I don't need to have maximum control about everything, I'd rather have it a little bit abtracted.


I head they stopped updating XNA some time ago, so I guess that one is outdated and I read that it's difficult to set it up for 3D.


Thanks in advance!



Soccer AI

16 July 2014 - 05:09 PM

I want to make a retro-ish soccer game. I want to keep it as simple as possible. I thought about basing it on 'Exciting Soccer' (video) or 'Nintendo World Cup' (video).
The only problem is making the AI. The ideal scenerio would be that I can first make the game AI only (so it basically plays itself) and later add an option for the user to take control of one player.
I'm not aiming for a super intelligent AI, but rather for a 'kind of interesting to watch' AI. 
I am aware of the book 'Programming AI by Example' wich has a whole chapter on this topic. And I don't own the book, but I have seen videos of the result and I'm not really impressed. If you look at this video you might understand what I mean. It seems like only the players closest to the ball are doing anything. Also note what players 4 and 7 are doing at 0:14. 


I find the AI of Exciting Soccer way more interesting, although it's actually very stupid. I just like how all the players are moving along with the ball and the game.


So my question is: Does anybody have any advice on how to make this? How do I make a fun-to-watch game of (seven a side) soccer where all players in the team seem to be playing together?


Many thanks!



Drawing entities from back to front

11 August 2013 - 04:47 PM

My last problem has barely been solved and I have already encountered the next one.


I am making a simple 3D first-person game. I made trees by rendering 2D sprites in my 3D world wich are always turned toward the player.


The tree sprites have some transparent pixels in them. When a few of them overlap, sometimes, a part of the fruthest tree is not rendered behind the transparent pixels of the one in front of it. It's hard to explain so here is a screenshot:



Anyway, I did some googling around and found out that the best solution would be to make sure everything is rendered from back to front.


Everything visible in my game is an entity and I just loop through them all every frame to render them, but now I'm going to have to make sure they are all rendered from far away from the player -> close to the player. That order could theoretically change every frame.


I wonder what would be an efficient way to make sure all entities are rendered ordered by their distance to the player? The height coordinate (Y-axis) does not matter in this case, because this is 0 for every entity.


Many thanks in advance,


How to avoid depth fighting

11 August 2013 - 08:41 AM



I am creating my first 3d game in java using the Lightweight Java Game Library and OpenGL.


I'm afraid I have just encountered the first problem so far for wich I can't find the answer on Google, so I decided to ask it here.


I have drawn four textured walls wich represent a house, and this works perfectly fine. However, Now I want to add a door to my house.

A door in my game is an entity wich is rendered as a rectangle just as heigh as a wall but with a door texture on it.


I was hoping that by drawing it later than the wall, it would just 'override' that part of the wall. This was not the case and the door and the wall started z-figting. So now it looks like this:


The door starts to flicker when the camera changes position.


If I disable GL_DEPTH_TEST, it looks fine from the right side, but if I stand on the other side of the house, I'll still see the door through the house, like this:



I understand this can be solved by drawing the part left and the part right of the wall seperately with the wall in between them, but I was hoping there is another way to solve this problem.


Many thanks,