Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Which programming language did you choose and why?

Jasede

Arcane
Patron
Joined
Jan 4, 2005
Messages
24,793
Insert Title Here RPG Wokedex Codex Year of the Donut I'm very into cock and ball torture
Yes, I have a general idea:

It's going to be a pixel-art platforming game with puzzle elements and chiptune music. It will also have a deep message.

It's going to be an RPG in the style of KOTC. But one first needs more experience in C++, with using open engines and with creating art assets, as well is with the music trackers and the writing of design documents before I can say anything more about it.

Maybe KOTC 2 will come out before I have all that and we can just make stuff in that. D:
 

Goliath

Arcane
Zionist Agent
Joined
Jul 18, 2004
Messages
17,830
"C/C++" would be an appropriate description in my case. I use C++ as glorified C, I strongly dislike the STL and the whole "templates all the way down" style of coding. However, I love functors, constexpr, RAII, function overloading, etc. I actually do use classes but only as syntax sugar for C style incomplete type ADTs. Don't like OOP at all, inheritance .. yuck. I like my code decoupled, thank you. I was a typical C Nazi, "C++ to the gas chamber!" kind of guy until I realized that you don't have to use the STL. Here is what my current code looks like:

Code:
Path snowballPath = PathFromTo(self.Position(), enemy.Position());

for each (position, snowballPath)
  window.Draw(position(), Snowball);

A thing of beauty if you ask me. Barely recognizable as C++, though. I wrote everything from scratch on top of the C standard library.

More game code:

Code:
if (item.HasAttribute(ItemAttributeHeavy))
  window.Draw(ColorRed, "Too heavy");

Notice the utter lack of C++-style namespaces. I read BS's technical justification for them, and I cannot argue with it. However, fortunately my programs will never become that big so I can afford not to use them which is great because .. goddamn the syntax is UGLY! (the only thing uglier is templated container syntax.. templated containers are another thing I don't use)

Code:
if (character.WeaponSkill() < character.WeaponSkillAbsolute())
Code:
character.Strength(character.Strength() - strengthReduction);
Yes, I am really that evil. I use operator overloading to mimic Ruby-style accessors. The last example would look like this in idiomatic C++
Code:
character.SetStrength(character.GetStrength() - strengthReduction);
Yuck.

I also "improved" the syntax by making heavy use of the C preprocessor:
Code:
times (10) ConsoleWrite("Java programmers are gay!");

Hopefully I will complete the game. I am so looking forward to the comments about the source code! :lol:
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Hopefully I will complete the game. I am so looking forward to the comments about the source code! :lol:

Interesting, why don't you write a quick "tic tac toe" or something and give us the source so we can study it and inquire you further!
 

DakaSha

Arcane
Joined
Dec 4, 2010
Messages
4,792
because its too much work and we wouldnt agree on anything in any case
 

Goliath

Arcane
Zionist Agent
Joined
Jul 18, 2004
Messages
17,830
Hopefully I will complete the game. I am so looking forward to the comments about the source code! :lol:

Interesting, why don't you write a quick "tic tac toe" or something and give us the source so we can study it and inquire you further!

Notice the :lol: I was joking, I am not looking for comments, I know what I am doing. It's just that I expect a lot of "WTF is this?!" kind of comments about the code should the game ever become popular.
 

Goliath

Arcane
Zionist Agent
Joined
Jul 18, 2004
Messages
17,830

Right, the correct term is "Free Software".
Richard%2BStallman.jpg


:p
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Notice the :lol: I was joking, I am not looking for comments, I know what I am doing. It's just that I expect a lot of "WTF is this?!" kind of comments about the code should the game ever become popular.

I know you expected a lot of "WTF is this?!" kind of comments, but I thought you were trying to spread the word too.

EDIT: I'm seriously considering making my source code open, but it would be a paid game. As in you can buy the game and download the source code for free that would come without the art/music/story/characters/stats.
 

Jaesun

Fabulous Ex-Moderator
Patron
Joined
May 14, 2004
Messages
37,257
Location
Seattle, WA USA
MCA
And there's lots of engines out there already

This. Jaeson himself works with an open source clone of the Gold Box engine (Dungeon Craft), so I wonder what's behind that comment.

It was more of a curiosity. I don't know shit about programming, It just seems programmers seem to do the Lone Wolf thing and invent their own version of the wheel. Granted cRPG engine wise, the only one I know of is FRUA and Dungeon Craft.

Anyways sorry for the derail. Carry on.
 

Hirato

Purse-Owner
Patron
Joined
Oct 16, 2010
Messages
3,958
Location
Australia
Codex 2012 Codex USB, 2014 Shadorwun: Hong Kong
Why don't all you smart guys get together and do an open source cRPG turn based engine?
I have been working on one for the past 3/4 years and at the rate things are progressing, I'll probably be ready to call it a beta by year's end...
But all things considered, I'm frankly still far too embarrassed to post about it on the codex. :oops:

It is unfortunately not turn-based at present, but I don't think that'd be difficult to do.
The hardest parts would be, in my opinion, determining who is in combat and of course hacking some sort of grid-based movement system on top of it.
let's just say cube 2 was never meant for this kind of game...

I did free the cursor not too long ago, so it can move around freely on the screen, which should make it a cinch to change the view into a top-down/isometric kind of view. And I tweaked the raytracing, so it accurately traces to whatever the cursor points at. All in all this should help get to the end result, which is turn-based combat with a suitable interface.

But that's all for the future and if I decide to pursue it, I did mention cube 2 was never really meant to support this kind of game.



"C/C++" would be an appropriate description in my case. I use C++ as glorified C, I strongly dislike the STL and the whole "templates all the way down" style of coding. However, I love functors, constexpr, RAII, function overloading, etc. I actually do use classes but only as syntax sugar for C style incomplete type ADTs. Don't like OOP at all, inheritance .. yuck. I like my code decoupled, thank you. I was a typical C Nazi, "C++ to the gas chamber!" kind of guy until I realized that you don't have to use the STL.

I approach C++ more or less the same way, although our styles do have a few differences (I use the OOP paradigm, a few namespaces, not nested of course and I never use classes or the private/protected keyword, which also mean I never use getters/setters that only interact with a single variable).
But regardless I think you deserve a bro fist for responsible (ab)use of the C++ language :salute:



To answer the op's question.... I'd pick C/C++ for the engine, and if the game is really small too, I'd most definitely use it for everything else as well... (like nethack)
When the project is a lot bigger on the other hand, you will be best served by integrating some sort of scripting language which interacts with the game logic parts of your engine.
Lua is a probably the most popular language for this niche, but there are many others, some based on LISP, others on ecmascript and I've heard of python and even Mono/C# being used here as well...
I personally only have experience with cube 2's built in LISP-like scripting language (otherwise known as cubescript)...
 

J1M

Arcane
Joined
May 14, 2008
Messages
14,629
Why don't all you smart guys get together and do an open source cRPG turn based engine?
People would never agree on D&D 3.5, 4E, SPECIAL, or whatever other pet system they wanted.
Someone would waste a year trying to make it real-time.
In the end it couldn't be published due to licensing.
 

Destroid

Arcane
Joined
May 9, 2007
Messages
16,628
Location
Australia
I don't see why people couldn't create an original setting, nor any reason to use DnD or Special rules, neither are very good.
 

20 Eyes

Liturgist
Joined
Nov 23, 2010
Messages
1,395
I don't see why people couldn't create an original setting, nor any reason to use DnD or Special rules, neither are very good.

Thinking of the game rules and testing them out is the most fun part for me. Teaching myself programming is just means for me to make it a reality. Nobody wants to code somebody else's RPG systems and then add/change a bunch of shit around until that person is happy with it, at least not for free. 'Designer', by itself, is a pretty worthless job in indie game development. My long term goal is to make something like KotC or a Spiderweb Software game with rules and a setting completely designed by me.
 

Temaperacl

Erudite
Joined
Oct 22, 2002
Messages
193
For the original question, it depends on what I am working on:
Simulations: C/C++ & Assembly
Minor Tools: C#, C, or Python (depending on need)
Games: None of them have been "completed" since the early 90s, but the recent efforts have generally been either C/C++ or C#.

Sometimes the graphics engine decides the language, and sometimes the language decides the engine choices. Engine/library-wise, the main ones I've used extensively are SDL and Allegro with C/C++. Panda3D / C++ was one of my favorites. I've never actually tried using it for a game, but it worked well for sim visualization - I use this where text output or postprocessing won't cut it. Some of the C++ side of things wasn't too well documented at the time, and don't know if this has improved in the meantime. The Python side was pretty well documented, but I haven't tried it out.

I've dabbled a bit, but I don't have any engines I've used extensively with C# - I'm currently looking at AgateLib.


I approach C++ more or less the same way, although our styles do have a few differences (I use the OOP paradigm, a few namespaces, not nested of course and I never use classes or the private/protected keyword, which also mean I never use getters/setters that only interact with a single variable).
But regardless I think you deserve a bro fist for responsible (ab)use of the C++ language :salute:
I used to have the same view on the STL, but the (project I've worked on for most of the) past decade has somewhat softened my view on it*. For many cases, the ease of use of the templates make them worth at least considering unless I need the extra performance of a custom algorithm or structure (Or, more often, when I can't afford or don't want to have to deal with the memory waste of the structures).
* - But not towards basic_string, which can be useful, but which I have seen abused so much. Nor towards the vector<bool> specialization, which is a terrible thing.

Another difficult point about C++ (but not C) is debugging. Visual Studio has an excellent debugger, but it's not free.
Visual studio has a good debugger if you are running unoptimized code and debugging at the language level. The VS debugger (up to VS2008 anyways - haven't tried low-level debugging with VS2010 or VS11) is pretty bad (and buggy) if you ever have to drop down to the disassembly and is fairly useless with optimized code debugging at the language level. I've found that the VS debugger and OllyDbg are a good combination for C++ debugging.
 
Joined
May 29, 2006
Messages
5,364
Location
Astrology
Blitzbasic all the way, it comes with its own 2d engine and is like java but easier
It's sister language monkey can even export to flash and JavaScript
 

shihonage

Subscribe to my OnlyFans
Patron
Joined
Jan 10, 2008
Messages
7,163
Location
location, location
Bubbles In Memoria
Monsterland, my sci-fi themed rogue-looking shooter, is being written in Free Pascal and SDL. Because its core was written in Turbo Pascal when Backstreet Boys were new and fresh.

Shelter, my RPG, is being written in Visual C/DirectX, because I like to have low-level control in games which demand performance. It needs performance, because much of the world's behavior is driven by in-house realtime language interpreter (ShelterScript). For example, a Fallout2-like encounter can be done entirely through ShelterScript, without recompiling the game's executable.

Shelter's dialogue and quest compiler (data tables ---> ShelterScript) is written in Pascal.

I prefer to know a few tools but know them well, rather than constantly "re-educate" myself on the newest and greatest stuff. I'm not really a 'programmer' in that respect, which is why I've grown to hate my software dayjob. They constantly try to fill my brain with new tools, rather than allow me to create. And the learning methods are rigid and inefficient - I learn by imitation and tinkering with other people's work, not by attending 8-hour lectures by some bleating tech drone.

I'm a proficient 'builder/creator of complex things', and programming just happens to be the tool I currently use. If Basic was the only language ever invented, I'd be happily writing an RPG in Basic. If I was born in ancient times I would be making a variety of devious mechanical contraptions.
 
Self-Ejected

Davaris

Self-Ejected
Developer
Joined
Mar 7, 2005
Messages
6,547
Location
Idiocracy
These days the question should be, Which game engine did you choose and why?

IMO, game engines are becoming for game programmers, what 3D Studio Max and LightWave are, for digital artists.
 

Jasede

Arcane
Patron
Joined
Jan 4, 2005
Messages
24,793
Insert Title Here RPG Wokedex Codex Year of the Donut I'm very into cock and ball torture
Isn't asset creation going to be hard anyway?
That's the one thing that keeps me from tinkering more with making a game. How do I make it look good? How do I learn to make (pixel) art or draw monster portraits or sprites? I have zero artistic inclination.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Isn't asset creation going to be hard anyway?
That's the one thing that keeps me from tinkering more with making a game. How do I make it look good? How do I learn to make (pixel) art or draw monster portraits or sprites? I have zero artistic inclination.
I face the same problem, alas if I were an artist I would end up in a deviantart forum crying about how i'm not able to program a thing.
 

Jasede

Arcane
Patron
Joined
Jan 4, 2005
Messages
24,793
Insert Title Here RPG Wokedex Codex Year of the Donut I'm very into cock and ball torture
Seems so weird, you'd think making a bunch of pixels look decent is easy.
Well... nope. It's probably best if you know how to draw first and have an eye for those things.
 

Tramboi

Prophet
Patron
Joined
May 4, 2009
Messages
1,226
Location
Paris by night
C++ all the way for professional game development

Pros:
Efficient, no bullshit, static typed
Easy to interact with external code
Easy to use SIMD intrinsics on any major toolchain
Portable like hell
Industry standard, you can find proficient people
Cons:
Quite hard to master
Quite slow to compile
Hard to parse, so limited IDEs compared to simpler languages
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom