• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
fir

C in game development

36 posts in this topic

Programming languages are for people, not computers. Even assemblers offer us meatbags much in the way of convenience over inputting op-codes by hand (or even the hypothetical worlds simplest assembler that only lets us write those opcodes with symbolic names). So it is kind of silly to say that using one language or another makes the computer think in a certain way. Demonstrably not true. Using one language or another makes you think in a certain way, but not the computer.

 

Program in C if you want. That's fine and dandy, but the only thing that C actually offers over C++ is that its a model your own human brain is more comfortable with, and perhaps that its marginally more portable to extremely limited or esoteric platforms, related mostly to the fact that its runtime is simpler and more compact than the C++ runtime -- take note, however, that only the first of those things is any benefit to you as the programmer.

 

There's a significant amount of software out there that's written in C, its not going to disappear. A lot of that software re-invents aspects of what's already provided in C++ or in other languages. But given that C is a nearly-perfect subset of C++ (There may be differences in the standardese or other small things, but truly impactful differences are essentially non existant), Microsofts slow adoption of C99 not withstanding, there's no really reason to limit yourself to 'C'. If strict C compatibility isn't something you need, you can merrily code along in C and then pull in bits of C++ as needed, rather than reinventing them yourself. Its probably wiser to just learn and use C++ proper, but at least it saves you reinventing the wheel.

1

Share this post


Link to post
Share on other sites


worse thing is that they are static sized tables and i do not know how achive flexibility in such static array approach,

 

soft code array size in data file. 

 

read in array size from data file at program start. then malloc entire array at once at program start, and free at program end. set array size big enough to get the job done.

 

the speed of static arrays, and the variable size of malloc'd arrays.

2

Share this post


Link to post
Share on other sites


c in game development (in relation to c++ usage) ? In big games?

 

i've been writing games in C since 1989 or so. I've done a number of large titles in C. my current project is in C (in a c++ compiler) and tips the scales at about 70,000 lines of code so far. a typical big game for me is about 100,000 lines of code.

2

Share this post


Link to post
Share on other sites

 


worse thing is that they are static sized tables and i do not know how achive flexibility in such static array approach,

 

soft code array size in data file. 

 

read in array size from data file at program start. then malloc entire array at once at program start, and free at program end. set array size big enough to get the job done.

 

the speed of static arrays, and the variable size of malloc'd arrays.

 

 

But what with large c projects (such like windows/linux/gcc)

Are they internally static array based, what is their main containers for data? As I said if this is static arrays it is prone to overflows (mallocked to), static arrays with realloc? If this is something like linked list of structures it would be much slower... 

0

Share this post


Link to post
Share on other sites

 


c in game development (in relation to c++ usage) ? In big games?

 

i've been writing games in C since 1989 or so. I've done a number of large titles in C. my current project is in C (in a c++ compiler) and tips the scales at about 70,000 lines of code so far. a typical big game for me is about 100,000 lines of code.

 

 

I would say 100k-lines are medium size not big. I belive any big title commercial game shipped to shops is much larger (how much?)

My own home framework with some unfinished prototypes

of 2d games has 100k-lines by now. Big game is probably about 1M-lines and more

0

Share this post


Link to post
Share on other sites

This has devolved into a language flame war.

You say that as if it were a surprise :)

Granted, this was a zeitgeist topic about, what, 15 years ago but when have these threads ever ended well? Still, if anyone needs any more gasoline to throw onto the fire I'm here all day (or at least until the inevitable lock).
0

Share this post


Link to post
Share on other sites


if anyone needs any more gasoline to throw onto the fire I'm here all day

 

now i got your first comment on that^^

0

Share this post


Link to post
Share on other sites


You are not making the CPU think in any particular way at all, to even consider that is frankly stupid.

I'm not talking about the physical CPU. I'm talking about the CPU from the vantage point of purely the language. If I could express my point more clearly in the previous post, what I was trying to say:

 

Computer instructions are roughly the same either way on the physical machine for similar C and C++ programs, but C++ offers a different way of organizing your data and methods. The computer, however, runs instructions one by one (for the most part) in programs, and does not concern itself with objects and the like. The computer just runs a sequence of instructions. C, however, is more closely based off of the linear organization and execution path that an actual computer follows. The underlying computer does handle functions and memory addresses and data types. The underlying computer does not have class/object manipulation instructions or private/public this and that.

 

I wasn't trying to make it sound like I thought the CPU architecture was dynamic based on the language used to program it, although you may find this post equally stupid.

-1

Share this post


Link to post
Share on other sites

Computer instructions are roughly the same either way on the physical machine for similar C and C++ programs, but C++ offers a different way of organizing your data and methods. The computer, however, runs instructions one by one (for the most part) in programs, and does not concern itself with objects and the like. The computer just runs a sequence of instructions. C, however, is more closely based off of the linear organization and execution path that an actual computer follows. The underlying computer does handle functions and memory addresses and data types. The underlying computer does not have class/object manipulation instructions or private/public this and that.


And the private/public nature of fields and functions has zero impact on the instruction stream the CPU sees, they are just a human abstraction, so what is your point again?

More importantly why is that abstraction 'bad' yet structures, which a CPU has no concept of either, fine?

Also CPUs don't "handle functions"; they have jump instructions but the whole 'function call' concept is, again, a human abstraction. A CPU has no more idea about a calling convention or a flow than a hamster does.

It sees a stream of instructions; coming from C or C++ makes zero difference in the grand scheme of things. Edited by phantom
2

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0