Jump to content

  • Log In with Google      Sign In   
  • Create Account

PragmaOnce

Member Since 01 Apr 2013
Offline Last Active Nov 15 2014 11:05 AM

#5122627 The most innovative development in First Person Play I've ever seen...

Posted by PragmaOnce on 10 January 2014 - 10:39 AM

Although these are very cool mechanics it has already been used in a game that was created for a ludum dare in 2012. Check this out smile.png

Well it uses the principle of perspectives but it doesn't go as far into portals and what not :P 

 




#5121686 scripting and unity3D

Posted by PragmaOnce on 06 January 2014 - 12:50 PM

Well, when I started with Unity I also only knew C++. You'll find that the syntax is almost exactly like C++. So instead of learning C#, do the tutorials and get familiar with the syntax but focus your efforts towards understanding the Unity API. Because the majority of your programming will be based on functions/variables that already exist within Unity.

 

Goodluck smile.png




#5121675 scripting and unity3D

Posted by PragmaOnce on 06 January 2014 - 12:03 PM

The projects on the unity page are quite nice to work through. The first one touches on some of the basic concepts and the third one goes into more advanced coding techniques. 

 

http://unity3d.com/learn/tutorials/projects

 

There is also a manual that explains the theory behind unity concepts and a reference guide that can be used to check functions and search for a specific behavior etc.

 

http://unity3d.com/learn/documentation




#5121421 Learning 3D and physics.

Posted by PragmaOnce on 05 January 2014 - 11:08 AM

Wow! Thanks for the long and detailed answer!

Since I am not interested into making a game (ie: campaign, story, etc) I think that I'll try to make my very own engine. I already know OOP but I have no idea how to implement physics. Do I need some extra libraries/APIs/Tools or is it all about coding?

 

It really depends. There are API's like Box2D and Bullet that you could use to implement physics or you could code it yourself. When it comes to implementing physics you generally have two aspects to look at. Detecting a collision and resolving the collision. Now before you can start with your 3D physics you're going to need to do 2D. 

 

Now there are thousands of ways to to implement a physics engine and even more ways to optimize them. I am not too experienced when it comes to physics and I don't want to give advice that is above my skillset so I will provide you with some links that I have used to implement physics. Most of the material is the same but covered in another way or maybe with more details, by studying all of these you'll hopefully be able to understand how a possible implementation could look.  Hope it helps. 

 

http://gamedevelopment.tutsplus.com/tutorials/collision-detection-with-the-separating-axis-theorem--gamedev-169

http://gamedevelopment.tutsplus.com/tutorials/create-custom-2d-physics-engine-aabb-circle-impulse-resolution--gamedev-6331

http://www.wildbunny.co.uk/blog/2011/04/06/physics-engines-for-dummies/

http://www.wildbunny.co.uk/blog/2011/12/14/how-to-make-a-2d-platform-game-part-2-collision-detection/

 

A lot of theory: http://buildnewgames.com/gamephysics/

 

As I said earlier the key thing is to do a lot of research, whenever you find a nice website/link. Bookmark it so that you can come back to it later.

 

EDIT:

 

Also, to really understand these you are going to need to be familiar with vector math:

http://www.wildbunny.co.uk/blog/vector-maths-a-primer-for-games-programmers/vector/#Magnitude




#5121413 Learning 3D and physics.

Posted by PragmaOnce on 05 January 2014 - 10:44 AM

Firstly you are talking about two completely different disciplines found in game development: A programmer and a 3D artist. I am no artist so I won't be able to help you regarding the 3D modelling, but you need to decide what you are going to focus on. I am a programmer so I can give you some advice from my perspective.

 

Making a game engine without any previous experience will be more of a learning experience rather than actually finishing it and developing a game in it. If you want to improve as a programmer and love solving complex problems while maintaining a good architecture try and make your own game engine, BUT if your goal is to actually develop a game then using an existing engine is probably your best option. The reason I say this is because learning about all the different implementations, systems and methods in a game engine is a very long process and can be quite daunting to new programmers. However, since you specifically asked how to implement your own engine I will provide possible steps to take concerning both processes.

 

Using an existing engine:

 

One of the best free engines out there (opinion)  is Unity. With the new iteration (4.3) it is not only a 3D engine but allows users to easily make 2D games as well. The nice thing about unity is that all the complex math and physics are already done for you so you can focus on gameplay elements. You can also build your games for multiple platforms.  The scripting languages you can use are C#, Javascript or Boo (the syntax is a lot like python).

 

There are a lot of other engines to choose from so doing a quick search on google will get you far. 

 

Creating a custom engine:

 

The thing about game engines are that you won't find a tutorial anywhere that goes step by step in implementation, so a lot of research is involved. By researching modular systems found in a game engine you can learn more about the implementation of such a system. 

 

Now there are a lot of engine systems that are not that important for a basic engine, for example: a memory management system. So without further ado here are some of the more critical systems found in a game engine:

 

Input manager: You need some way to convert input from the user into logic that the rest of the engine can understand.

Rendering engine: This is the system responsible for drawing all your objects, an API like OpenGL or DirectX is used to do low level communication with the hardware.

Physics engine: Responsible for detecting and resolving collisions. 

 

Now those are only the critical parts, you will maybe need a event/messaging system so that your different systems can stay decoupled, or a interpreter if you want a scripting system. I can go on, and on for quite a long time discussing resource mangers and state management systems but as I said those are all research topics.

 

Steps in the right direction:

 

If you are set on creating a engine the first thing you will want to do is learn an object orientated language like C++ and master it. You want to make sure that you understand inheritance and polymorphism as well as knowing your object orientated design principles. 

 

Then start creating your own games using a library like SFML. Note that I said games, not game engines. SFML is nice because it already contains a rendering engine, input manager and various other systems that are useful for creating games without diving to deep into various systems. This will get you acquainted with main game loops and object hierarchies. 

 

The one thing that SFML lacks is a physics engine. So your next step could be to implement a very basic physics engine that detects AABB (basically a box around an object) and then resolves it. 

 

As your projects grow in size you might feel overwhelmed because everything feels like a big blob of code with new bugs popping up after every feature. This is a good indication that you need to start investing time in design patterns. These patterns are there to solve problems that occur a lot when programming in an object orientated language. 

 

After a while a game engine will actually evolve out of your games (or this is how it worked with me!). But the thing is, as you dive deeper into the various systems it takes a lot more time to actually get something done. Remember, you actually get programmers that are "specialized" in a certain field like physics or graphics. For a single programmer to learn techniques spreading over multiple domains takes a s***load of time and dedication. The thing is I love game architecture and implementing all of the different features but because it takes so long I divide my time between making an engine and actually making a game. 2-4 hours a day I will spend on my engine and 2 hours I will work on a actual game inside Unity.

 

I hope I helped a little bit and remember this forum has great resources and a nice community if you ever get stuck on something.

Happy devving smile.png

 

EDIT: I gave very vague steps on how to start with a game engine. Shoot me a message at anytime if you want to know about more concrete steps you could take, this is of course after you mastered an OOP language




#5109053 Strange dotted line following my "player".

Posted by PragmaOnce on 13 November 2013 - 02:54 PM

Hi there.

 

7d6347288739276.jpg

 

Are you talking about the fact that the player isn't buffered correctly. I used a pink square as my "you sprite". This line you are talking about is probably what Eck has mentioned.

Now I am not familiar with python/pygame (remember I downloaded it last time to help you tongue.png ) but..

 

I'd say you call this after updating display:

pygame.display.flip()

 

Also, put your code in code blocks next time to it's easier for other people to help you. Just click on the < > button that appears in the editor menu and paste your code in there, selecting the generic code option.

 

EDIT: That didn't work, i'll check what other functions are available ^^

Found the problem : You need to fill the screen with a color after you draw to it to "reset" it basically. So right after you do your display.update, add this:

 screen.fill(pygame.Color(0, 0, 0, 255))

This just fills the room with black. 




#5107728 Need help with Python/Pygame Collision

Posted by PragmaOnce on 07 November 2013 - 01:38 PM

Of course, but take in consideration that he has stated that he is just a beginner. At this stage it is of critical importance to take the knowledge you have, and convert it into code. He could spend another few months learning the theory behind everything needed to structure a game without ever accomplishing something - or he can learn something, do something practical with it and improve on it when he learns something new.

 

I could have given an example with a player class.. but it still would be "messy" code. I'll have to add something like an:

- Object Manager ... nope still bad coding practice, resources are not loaded properly

- Add an resource manager, nope still not good enough, physics should be handled by it's own class.

- Add a physics manager. Logic and display should be decoupled, add a graphics class..

 

I could go on and on, there will always be more stuff that can be added to try and eliminate "bad practices". I did not want to write a 10 000 line game engine as an answer to his question so I adjusted my programming to fit his style, no matter at what level he is. I saw that he is not yet comfortable with functions so I excluded the idea of reference passing.

 

This guy is trying his best to create something while he is relatively new. As he does more he will realize that he needs something else, and he will ask more questions and so his programming practices will get better over time :)




#5107716 Need help with Python/Pygame Collision

Posted by PragmaOnce on 07 November 2013 - 12:08 PM

So after not understanding why it does not work, I downloaded python and pygame. And found out some pretty interesting things about it. The reason the function won't work is because x,y are not global variables. So instead of using a function just pop this in after you move:

 x+=movex
 y+=movey

#Checking for out of bounds
if y < 0:
    y = 0
elif y > 1080:
    y = 1080
if x < 0:
    x = 0
elif x > 1550:
    x = 1550



#5107709 Need help with Python/Pygame Collision

Posted by PragmaOnce on 07 November 2013 - 11:14 AM

I read up and the def keyword in python means that it is a function. A function is something that is initialized and then you can call the function whenever you want.

So put this code:

def is_within_borders():
    if y < 50:
        y = 50
    elif y > 1080:
        y = 1080
    if x < 50:
        x = 50
    elif x > 1550:
        x = 1550
    return True

Somewhere outside the loop. At the start of your code maybe.

Then you need to call the function when you want to use it so do this

x+=movex
y+=movey
is_within_borders()



#5107692 Need help with Python/Pygame Collision

Posted by PragmaOnce on 07 November 2013 - 09:12 AM

Okay I have never programmed in Python/PyGame before so I might be completely wrong... but

if the variables x, y define the position of your object :

 

Then this

#Attempting collision
def is_within_borders():
    if yPosition > 50:
     yPosition = 50
    elif xPosition > 1550:
        xPostion = 1550
    return True

 

Should be:

#Attempting collision

def is_within_borders():
    if y > 50:
     y = 50
    elif x > 1550:
        x= 1550
    return True

 

Also. You want to check this every step/tick of the game. So it should be checked in your main loop. I have no idea how pygame works as I said before.. so it might have already been in there smile.png So check for the object being out of bounds just after you have moved your object.

 

EDIT: Thanks CoreLactose, I didn't even bother to check the parameters :/




#5107689 Need help with Python/Pygame Collision

Posted by PragmaOnce on 07 November 2013 - 08:55 AM

How about you show us your code then :P




#5107210 Need a good 2D graphics program

Posted by PragmaOnce on 05 November 2013 - 12:17 PM

GIMP: http://www.gimp.org/ : It's like a free photoshop.

Graphics Gale: http://www.humanbalance.net/gale/us/ : Great for pixel art.

Spriter: http://www.brashmonkey.com/spriter.htm : Awesome for animated sprites.

 

But remember software can only get you that far! Make sure you practice a lot and learn new techniques.

Goodluck :)




#5107129 How do i start a game project?

Posted by PragmaOnce on 05 November 2013 - 05:01 AM

Hmm. Okay if you learn by looking at source code then your best bet is probably online tutorials. But you are going to need to give me more information.

 

- What language do you want it to be in?

- How experienced are you in that specific language?

- Do you want to create your own engine or do you want to use an existing one?




#5106974 How do i start a game project?

Posted by PragmaOnce on 04 November 2013 - 01:56 PM

I'm looking at the index and it actually looks like a very solid book. You might want to hear from members who have read it but by just looking at the index it is actually exactly what you need.

 

The reviews are looking quite good too; I think i'm going to buy it myself. Thank you for the suggestion tongue.png




#5106948 How do i start a game project?

Posted by PragmaOnce on 04 November 2013 - 11:38 AM

Ah okay good. You probably won't find any books that go into game play specific implementations like walking. But two books I would recommend are:

 

- Game Coding Complete: http://www.amazon.com/Game-Coding-Complete-Fourth-Edition/dp/1133776574

- Game Engine Architecture: http://www.amazon.com/Game-Engine-Architecture-Jason-Gregory/dp/1568814135

 

I bought these two books and at the time the topics covered were way over my head. But after I worked a bit on projects they became very useful. Unfortunately they don't cover a lot of depth in terms of networks.  






PARTNERS