Need some pointers to start programming


zonova

Member
Joined
May 8, 2012
Messages
165
Hey everyone, I'm sorry if this isn't the right place to post this question. I'm very interested in programming, looking at some of the emulators people have ported here sort of amazes me, and I would really like to know how they do it. I have taken a course on programming with Java, it covered basic logic and loops and that sort of stuff, and I picked up a book on C and am basically at that point in C as well. I'm very much a beginner programmer, but the thing is, I don't know what to look at next. Like, yay, I can do loops... but, that doesn't make me feel any closer to being able to write games or applications or emulators. I don't even know the first step in making those things. I looked up some stuff and read that, for emulators, knowledge of assembly is also pretty necessary, to at least supplement using C?

I'm assuming that, from my level, trying to write an emulator isn't really a suitable project. However, I guess what I'm really looking for is what the next, "intermediate," step would be for me, in terms of programming. Would you know of any books or tutorials I could look into? Maybe I should look at tutorials on SDL or OpenGL? I'm stuck in this rut of having the basic knowledge of programming and a passion to expand on it, but with no idea where to look.

Thanks guys!
 

Binky

Death's Steed
Staff member
Joined
May 28, 2003
Messages
6,997
Location
16A (TO)
If you're keen on making something interesting happen, I'd recommend Python/Pygame. It provides a nice clean interface to most of the things needed for game writing (don't expect brilliant performance though) and teaches you to indent code properly.

Alternatively, pick up an Arduino and some electronics bits (such as this http://oomlout.co.uk/collections/frontpage/products/arduino-starter-kit-ardx). You get used to a 'proper' programming language, and its can be incredibly satisfying to see your code having physical, real world effects.

What about trying to recreate some classic games - write a pong clone, space-invaders clone, breakout etc?
 
Last edited by a moderator:

TrashyMG

Sarcasm Dispenser
Staff member
Joined
Jan 18, 2010
Messages
11,092
I always find you need to find something you really want to make, the learning how to program part follows the process of getting that job done. And pick something that will give you a challenge.
 
Last edited by a moderator:

Exophase

Nothing good will ever come of Exophase.
Joined
Sep 21, 2006
Messages
10,308
Age
38
Location
Cleveland OH
You don't need assembly code in an emulator and a lot of them don't have any. But you need to understand how the CPU works on what you're emulating, which supersedes knowing its machine language.

At your level it's perhaps not to far out of reach to write something like a Chip 8 emulator (more of a virtual machine really, no real Chip 8 exists) There are lots of forum posts and guides for this. For example this: http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/ The guide says not to use it to learn programming, but I think it's a good starting point to read it anyway, and lookup things or ask questions when you're confused about something.
 
Last edited by a moderator:

monty

Member
Joined
Nov 12, 2007
Messages
203
Be careful of asking this question too widely! You are liable to get 101 different suggestions for 'best' languages for beginners. I'm biting my own tongue here ...

As to what specific aspect of programming you should focus on next; its very difficult to tell. If you've mastered loops and a few data types you could start throwing together programs already. I made my first 'game' when I knew less than you did. It was shit, but just making it helped. If you're the more methodical type then you should look at how to break down a program's functionality into discrete functions/methods, each one doing one thing and calling other functions for other tasks outside its remit.

But TrashyMG is on the money; you should pick a project that interests you, make a brief check with people (possible here) that its not going to be an impossible beast for a beginner, and just learn what you've got to learn to get the project done (even done badly).

Small games are a good one. Almost no-one ever finishes their first few game attempts, but that doesn't matter. I personally used DarkBASIC, but PyGame, Unity, Adventure Game Studio or any other would do the same. On the other hand you might be interested in physics, in which case try working out how to make a ball bounce around in 2D box or somesuch. Or you might like data, in which case try making a personal planner package, with tasks, a diary and all that.

Honestly, the only important point is that you get some enjoyment from it and fail in an educational way. Oh, and watch you back for the curly brackets, of course. They operate in murderous hunting packs.

EDIT: Oh yeah, and don't be afraid to resort to paper to work things out. Its all just logic and arithmetic, so if you get bogged down by the godsdamned compiler take a break to work as abstractly as possible.
 
Last edited by a moderator:

moxie

The voice of reason, sense and exasperation
Staff member
Joined
Aug 15, 2006
Messages
2,707
Age
49
Location
South of Sweden
Wot? Religious wars on programming languages? That could never be... :D

The problem with answering these kind of questions is that this kind of description:

it covered basic logic and loops and that sort of stuff, and I picked up a book on C and am basically at that point in C as well.

...can mean just about anything between "I can make a program that prints out a multiplication table" to "I keep trying, but I always get stuck in the transformation methods of the accelerated voxel engine of..." :) But if you happen to be more the former than the latter, I'd recommend these two books:

http://inventwithpython.com/

for a basic run through of how one goes from "computer program" to "computer game". The first one is very basic, the second goes into a bit more advanced topics. And before someone accuses me of language evangelizing, I'd like to say to my defense that the concepts in those books are simple enough that they ought to transfer rather cleanly to most any other language :)

If you're closer to the latter description, just ignore me :D
 

moxie

The voice of reason, sense and exasperation
Staff member
Joined
Aug 15, 2006
Messages
2,707
Age
49
Location
South of Sweden
...Then again, if you want to look at a small emulator written in C, you could look here:

http://ioccc.org/2013/cable3/

...or possibly not, as it is completely unreadable :) But still, it is (and I quote):

"This entry weighs in at a magical 4043 bytes (8086 nibbles, 28,301

bits). It manages to implement most of the hardware in a 1980's era
IBM-PC using a few hundred fewer bits than the total number of
transistors used to implement the original 8086 CPU."
 
Last edited by a moderator:

Binky

Death's Steed
Staff member
Joined
May 28, 2003
Messages
6,997
Location
16A (TO)
[nerd joke]

Will these do?

transparent_figure5.gif


[/nerd joke]
 
Last edited by a moderator:
Top