Author Topic: Amstrad GameDev Challenge: BASIC vs C  (Read 964 times)

0 Members and 1 Guest are viewing this topic.

Offline ronaldo

  • Dev
  • 6128 Plus
  • *****
  • Posts: 610
  • Country: es
    • Fremos Blog
  • Liked: 846
  • Likes Given: 797
Amstrad GameDev Challenge: BASIC vs C
« on: 12:52, 25 July 19 »
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
« Last Edit: 11:24, 05 September 19 by ronaldo »

Offline SpDizzy

  • CPC464
  • **
  • Posts: 37
  • Country: es
  • Liked: 17
  • Likes Given: 22
Re: Amstrad GameDev Challenge: BASIC vs C
« Reply #1 on: 13:54, 25 July 19 »
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!!

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 697
  • Country: gb
  • Liked: 238
  • Likes Given: 354
Re: Amstrad GameDev Challenge: BASIC vs C
« Reply #2 on: 14:11, 25 July 19 »
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.

Offline ronaldo

  • Dev
  • 6128 Plus
  • *****
  • Posts: 610
  • Country: es
    • Fremos Blog
  • Liked: 846
  • Likes Given: 797
Re: Amstrad GameDev Challenge: BASIC vs C
« Reply #3 on: 14:16, 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

Offline teopl

  • CPC664
  • ***
  • Posts: 78
  • Country: cs
  • Liked: 36
  • Likes Given: 55
Re: Amstrad GameDev Challenge: BASIC vs C
« Reply #4 on: 22:39, 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))


Offline zhulien

  • 464 Plus
  • *****
  • Posts: 433
  • Country: au
    • 8bitology
  • Liked: 195
  • Likes Given: 121
Re: Amstrad GameDev Challenge: BASIC vs C
« Reply #5 on: 16:48, 26 July 19 »
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.


Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.718
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 952
  • Likes Given: 1676
Re: Amstrad GameDev Challenge: BASIC vs C
« Reply #6 on: 00:59, 27 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

Offline ronaldo

  • Dev
  • 6128 Plus
  • *****
  • Posts: 610
  • Country: es
    • Fremos Blog
  • Liked: 846
  • Likes Given: 797
Re: Amstrad GameDev Challenge: BASIC vs C
« Reply #7 on: 19: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! :)


Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.391
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 791
  • Likes Given: 1666
Re: Amstrad GameDev Challenge: BASIC vs C
« Reply #8 on: 19:24, 07 August 19 »
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 (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.718
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 952
  • Likes Given: 1676
Re: Amstrad GameDev Challenge: BASIC vs C
« Reply #9 on: 12:53, 17 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

Offline ronaldo

  • Dev
  • 6128 Plus
  • *****
  • Posts: 610
  • Country: es
    • Fremos Blog
  • Liked: 846
  • Likes Given: 797
Re: Amstrad GameDev Challenge: BASIC vs C
« Reply #10 on: 00:39, 24 August 19 »
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! :)


Offline ronaldo

  • Dev
  • 6128 Plus
  • *****
  • Posts: 610
  • Country: es
    • Fremos Blog
  • Liked: 846
  • Likes Given: 797
Re: Amstrad GameDev Challenge: BASIC vs C
« Reply #11 on: 11:36, 05 September 19 »
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! :)