News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_ronaldo

Amstrad GameDev Challenge: BASIC vs C

Started by ronaldo, 10:52, 25 July 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ronaldo

Two weeks ago we started Amstrad GameDev Challenge: BASIC vs C, a series of livestreams on youtube about game programming for Amstrad. We are programming the same RPG game twice, both on Locomotive BASIC and C. The idea is to show some programming tricks, different ways to think and do algorithms and the differences between languages in a funny way, through a continuous challenge between #TeamC and #TeamBASIC. We intend this show to be of help to those who know one language and want to learn the other, and also for those who don't know how to program a game from scratch. We hope that programming the same under two different paradignms gives more insight into better understanding of programming itself.

If you like it, we are having one show every 2 weeks, on tuesdays, 21:00h (CEST time). Only problem: we are doing it in Spanish. However, all our code is done in english, for you to have some basis to understand what we are doing and being able to follow it, even if you don't know Spanish. It would be really amazing if someone wanted to collaborate by developing some English subtitles :) .

LINKS TO PARTICIPATE
EPISODES (list):



       
  • Episode 3 (06/08/2019)


       
  • Episode 4 - Advance about Memory Leak Mistery in BASIC (20/08/2019)


       
  • Episode 4 (27/08/2019)


       
  • Episode 5 -- Planned -- (11/09/2019)


Hope you like it! :D

SpDizzy

Tremendous idea!! Thanks so much once again @ronaldo for helping us with game programming. Not an RPG fan, but so invaluable to all of those, like me, that want to know how to program a game from scratch. Thanks!!

Sykobee (Briggsy)

That's cool.


BASIC with well implemented RSXs (graphics rendering, music, and so on - that 8BP library for example) versus plain C could be interesting to see.

ronaldo

Quote from: Sykobee (Briggsy) on 12:11, 25 July 19
BASIC with well implemented RSXs (graphics rendering, music, and so on - that 8BP library for example) versus plain C could be interesting to see.
Well, yes and no. In fact, is plain Locomotive BASIC without RSX or any machine language routine other than those provided by the firmware.

That's the challenge :D

teopl

Quote from: ronaldo on 10:52, 25 July 19
Only problem: we are doing it in Spanish. However, all our code is done in english, for you to have some basis to understand what we are doing and being able to follow it, even if you don't know Spanish. It would be really amazing if someone wanted to collaborate by developing some English subtitles :) .

If I ever learn Spanish it will be because of prof. retroman youtube channel :D And of course a strangely big Amstrad community in Spain with lot of content only in Spanish.
In fact, I did contact one language school and private teacher but I gave up because lack of time. For now :)

Anyway, I saw your gamedev challenge videos, looks very promising! That and many other videos from your channel are on my TODO list, I will definitely watch it even with auto-translate if needed...

And when I am already in poetic mood, I must add that coming back to Amstrad after ~25 years really changed my life for better and I have only started :P (and I guess that would not be the case without cpctelera, so yes, I also need to give my gratitude to @ronaldo and all the people involved. (sorry for a little of topic hehe))


zhulien

I know a lot of BASIC programmers are going to bawk at this, but, I have always found BASIC as structured as every other language, just messier.  Of course it doesn't force the structure, but if you are consistent, then you can use almost exact logic (other than pointers) in your locomotive basic than C etc. (and you will see more of this from me when I release my internet client soon).  Ultimately it reads a lot better in my view.  On CPC not as efficient though.


such as:

if (<condition>)
{
  puts('hello');
}

becomes

100 if <condition> then else 120
110   print "hello"
120 'end if

-------------------------


if (<condition>)
{
  puts('a');
}
else if (<condition>)
{
  puts('b');
}
else
{
  puts('c');
}

becomes


100 if <condition> then else 130
110   print "a"
120   goto 190
130 'else if
140 if <condition> then else 170
150   print "b"

160   goto 190
170 'else
180   print "c"
190 'end if

-------------------------

while (<condition>)
{
  int a = outputString('hello');
}

int outputString(char* s)
{
  puts(s);
  return 1;  // for the sake of returning something
}

becomes

100 while <condition>
110   a$ = 'hello':gosub 150:a% = r%
120 wend
130 end
140 '
150 'function outputString
160   print a$
170   r% = 1
180 return



etc...  much more manageable than using globals for everything.  A lot of people do forget about def fn too which can be very good for numeric functions (in a similar way to subroutines).  I generally try standardize on parameter names somewhat if I can.


AMSDOS

Quote from: ronaldo on 12:16, 25 July 19
Well, yes and no. In fact, is plain Locomotive BASIC without RSX or any machine language routine other than those provided by the firmware.

That's the challenge :D


Apart from the Interpreted Vs. Compiler situation, the BASIC Team have a real battle on their hands. Others have being able to show that to code well in BASIC, you need to think creatively and cleverly, which is what usually leads to an unreadable source code. They may decide to take a structured approach of coding it in BASIC which improves readability, though be a compromise on performance.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

ronaldo

And there it goes the third episode of #AmstradGameDevChallenge on youtube.

Remember that all source code, comments and commit messages are in English to help non-spanish users follow what we are doing.

Hope you like it! :)


GUNHED

A "learning" competition between BASIC and C is a great idea for sure.  :)


However, to have an RPG in mind is ... the type of game which makes the most work. Ok, sure, you probably can use the strength of one or the other languages better compared to a strict action game. But this look like a big project. So, GOOD LUCK to both teams!  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

AMSDOS

Quote from: ronaldo on 17:00, 07 August 19
And there it goes the third episode of #AmstradGameDevChallenge on youtube.

Remember that all source code, comments and commit messages are in English to help non-spanish users follow what we are doing.

Hope you like it! :)



I noticed some improvements in Variable names occurring in the Latest BASIC version, though in a couple of places 2 character variables were used, though I'm guessing you're aware of some routines to list what variable names are being used which usually help me to use up any single letter variables I haven't defined and just use Comments to specify what it represents.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

ronaldo

Advance of the episode 4 of #AmstradGameDevChallenge now available on youtube. Specifically dedicated to explain the misterious memory leak in BASIC, what is it, how it works and how to deal with it.

I'm keeping the first post in this thread updated with all the videos. Now you even have the link to the next live sesion, next tuesday, 27th of august, at 21:00h CEST time.

Remember that all source code, comments and commit messages are in English to help non-spanish users follow what we are doing.

Hope you like it! :)


ronaldo

Now available on youtube you have #AmstradGameDevChallenge Episode 4: UDG Graphics

You can find all the videos of the series in the first post in this thread, and the link to the next live sesion, wednesday, 11th of september, at 21:00h CEST time.

Remember that all source code, comments and commit messages are in English to help non-spanish users follow what we are doing.

And from previous episode, you also have our custom UDG Designer Spreadsheet, which generates BASIC and C source code!

Hope you like it! :)


Powered by SMFPacks Menu Editor Mod