pouët.net

Go to bottom

What is the language you use to program a demo and why?

category: code [glöplog]
What is the language you use to program a demo? I use Assembly language because it allows for more speed and size optimizations than C++ because there, the compiler does what it thinks is efficient which isn't always the best thing. DO NOT START A FLAME WAR HERE!!
added on the 2014-11-25 22:18:26 by PROSM PROSM
I've been watching someone streaming Rollercoaster Tycoon last night and I just realized how much of a pain in the ass it must've been to write that game in 99% ASM with all the crazy GUI going on.

But yeah, C++ is for cookie and it's good enough for me.
added on the 2014-11-25 22:23:15 by Gargaj Gargaj
@Gargaj , that fact (which I'd known before) is just insane. Huge props to Sawyer.

On topic, I've done two demos with JS and CSS packed in to images. In the future I hope to perhaps dabble with WebGL. The advantage for me is that development is easy to get going on. Have browser, will travel. That sort of thing. You're not going to be a speed demon on teh order of some other things, but overall not too bad. Perhaps ASM.js can be used for the people really after speed, though I don't know if the requisite coding styles for ASM.js defeat size-coding.
First I write a simple compiler. Then it's turtles all the way up.
added on the 2014-11-25 22:44:39 by revival revival
I use Java because... dunno, must have been the shit I smoked or whatever.
added on the 2014-11-25 22:48:32 by Scali Scali
Depends on the platform. Most old hardware gets programmed in assembly, but for PC unless its size coding there is not really any need to use asm. The bulk of work in a modern pc demo is done on the video card anyway. I usually use C/C++ except for when I made a 1k demo which was coded in x86 asm. The very first demo I made when I was learning to code on pc was written in javascript/webGL.
added on the 2014-11-25 22:49:28 by drift drift
C++ and GLSL on PC, assembly on other platforms.
added on the 2014-11-25 23:01:49 by Preacher Preacher
HLSL, then C++. Wish I'd do a data driven demo one day over a self-written C# tool, but that's wishfull dreaming.
added on the 2014-11-25 23:06:16 by xTr1m xTr1m
I use Assembly because on 8-bit systems this is the only way to achieve anything reasonable.
added on the 2014-11-25 23:13:00 by introspec introspec
I think there have been a small few oldschool demos done by cross-compiling C/++ (I think) from another newer platform. I don't remember the last one where the author indicated that's how it was done (or how they did things).

Searching indicates one such possibility for the ZX Spectrum.
@Starchaser, we were explicitly instructed not to discuss :)

However. There are several cross-compilers for Z80, implementing various subsets of C (my experience is with Z80 and ZX Spectrum programming). However, the quality of the resulting code is not good (Z80 is not particularly C-friendly), plus, most of these compilers regularly exhibit some pretty horrific bugs. There is no serious competition to Assembly at present.

Although yes, you are right, there are games written using C with specially-designed assembler-based libraries, and some of these games are pretty decent. Demos are different in that the expectations are quite a bit higher. Render quality acceptable for a game may not be taken seriously in the case of a demo.
added on the 2014-11-25 23:34:16 by introspec introspec
Quote:
I think there have been a small few oldschool demos done by cross-compiling C/++


A "small few"? :)
added on the 2014-11-25 23:49:50 by superplek superplek
It said no flame wars. :) I do agree with you, though.
C++ leads you to the dark side, where if you aren't careful you spend too much time making well rounded classes than actually "making stuff thats used". You can end up trying to solve all the worlds problems with a group of C++ classes by homogenizing everything.

My current philosophy for stuff I do in my scarce free time is to only write whats absolutely necessary, and make it as lightweight and reusable as possible.

On one hand, I want enough boilerplate code to jump me straight into a mymain() with everything ready to go, and before that there is a quick mysetup() call to override any default resolutions / show mouse / go fullscreen that kind of thing. but its all straight C. struct's are used to handle related data along with some simple management for scenes/layers in scenes, shaders, assets (vbos etc), lists of transforms with caching. simple object based (where a struct is an object not a class) scene management makes things easy to clean up.

Currently Windows/OpenGL modern style (not immediate mode). Next task when I get back to writing code is a cross-platform refactor to dev for iOS and Windows as I have a small app I want to make. i want to write the bulk of the code on windows and it will require little porting to iOS with minimal objective-c to wrap functionality like aspect ratio/resolution differences, rotate and touch which I can simulate via mouse clicks/key hits to resize the window in my windows dev version. so in C, pretty much writing straight to the api with some helpers to smooth the bumps out and manage things.

I figure the critical path when drawing stuff ends up being mostly a few functions in C++ apps anyways.
added on the 2014-11-25 23:52:23 by Canopy Canopy
C++ with Lua bindings for rapid prototyping and possibly protoduction.
added on the 2014-11-26 00:22:40 by fgenesis fgenesis
I'm a c junky
added on the 2014-11-26 00:26:01 by sigflup sigflup
cpp & hlsl
added on the 2014-11-26 02:26:35 by Igoronimo Igoronimo
thread can be extended to consider IDE too, in the facts of coding.

about me, cardiac was coded Pascal and Assembler, while no, stars, heaven, cob, hugecrowd, TCF, TLDOLA in full T(-URBO)ASM. I've resume coding C/C++/ASM with WATCOM, and then visual studio, codeblocks, and xcode. moreover, I have my own shader pseudo-language to enable compilation to HLSL or GLSL and my faster than LUA Scripting pseudo-language.

for the web, PHP is the only language I really know.
added on the 2014-11-26 03:09:00 by Barti Barti
For PC-Demos C should be all you need.
Maybe C++ if you want to do some fancy stuff with Objects.
C# (or Qt for multiplatforming) if you want to code a DemoTool.
x86 is nice for small stuff like 4k-basecode, that doesn´t change too much from project to project, otherwise it´s too much of fiddling around, and not time-efficient enough for some hobby-code. And for <4k-stuff aswell ofcourse.
For shaders it doesn´t matter i guess...HLSL in my case, but GLSL is absolutely fine aswell.
IDE is Visual Studio (any version) in my case...it´s just almost perfect in usability.
Assembler, bcoz C is jarig.
added on the 2014-11-26 10:02:29 by g0blinish g0blinish
C++ for PC, Assembly and even some C for retro platforms.
added on the 2014-11-26 10:59:08 by Optimus Optimus
My own. Excerpts from Painter's frustration:
Code:proc tegning1 # grass tint 3 fork streg 1 240 0 2 22 40 wait 60 # house tint 0 fork streg 50 240 ~64 1.5 4 16 wait 20 fork streg 48 178 0 1.5 4 16 wait 20 fork streg 110 180 64 1.5 4 16 wait 30 fork streg 32 190 ~32 1.5 4 16 wait 20 fork streg 78 144 32 1.5 4 16 # tree wait 50 fork streg 285 220 ~64 3 8 24 wait 40 jump 300 144 size 9 tint 3 face 0 fork smoke 5.75 322

Code:proc streg x0 y0 d step l t jump x0 y0 face d temp s = step*step size s defy seed x*y temp n = (l/step*16)&~1 fork stregstep d step t*step/l/16 n proc stregstep d step w n when n draw wait w move step temp rel = dir-d defy turn (rand-0.4-rel*0.0078125)*5 fork stregstep d step w n-1 done
added on the 2014-11-26 11:01:21 by Blueberry Blueberry
I went all the way from various dialects of BASIC to Pascal to Delphi to Java / Processing to C++, then C, some x86 / 65xx Assembly in between. Besides random horse shit, I don't really do demo programming (or any kind of programming really) anymore. I think I enjoyed the Delphi days the most. If I'd start again, I'd write the whole thing in a shader and do the boilerplate stuff in C#. Or some whacky stuff I never tried before.
added on the 2014-11-26 13:31:51 by tomaes tomaes
finnish
added on the 2014-11-26 13:35:47 by Maali Maali

login

Go to top