9

Hi!

I have just started to learn game development. My only programming experience comes from making few simple things in BASIC more than 15 years ago, but when I found PICO-8 (thanks to the C.H.I.P Kickstarter) I felt a nostalgic pull and decided to jump in into this whole gamedev thing.

I have started a blog: Level0GameDeveloper where I document this journey and explain everything what I am doing, so maybe someone like me (who doesn't have an idea where to start with this whole game making thing) will find it helpful and will also give it a try (maybe even with PICO-8?!).

Anyway, I was hoping that you guys could give me some pointers, as many of you are, what I would consider, amazing programmers (I have seen your code!). The great thing about Pico-8 is that I can lookup any source code to the carts posted here and learn from that, but I find myself really struggling understand a lot of it, as I don't know Lua (or programming practices past the basics really). Right now I am working on expanding the pong clone from Pico-8 Zine#1 and it is going alright, but I am afraid that the lack of knowledge of Lua/Pico-8 functions will make me reach a standstill, or I will get frustrated and give up :(

Any advice you would give to a new programmer? Any books or articles you could recommend (especially about Lua, or basics of programming in general)? I have already gone through the zine and manual (however the manual doesn't explain things very well, but it is a good reference) multiple times and I use this BBS daily, so I am looking for any other resources.

So far I am having a blast and I think I can actually do this, but I would love some advice, so I won't give up. Any help would be greatly appreciated.

P#20830 2016-05-18 23:04 ( Edited 2017-10-10 01:19)

I just started developing for Pico-8 looks at watch 10 minutes ago.

 ```x1=0 y1=0 x2=128 y2=128 cls() function _draw() line(x1,y1,x2,y2,1) end function _update() x1=x1+2 end ```

My only goal was to get some pixels on the screen and start learning the functions built-in to the system and just put some pixels on the screen. Next I'll probably figure out how to save, load, export and advanced way to edit my code.

Whatever you goal is, start with the smallest goal possible and reach that. Then set a new one and keep going.

If you want to make someone jump across the screen you are really saying you want...

• Get graphics on the screen
• Update the screen
• Calculate a jump arc
• Animate a sprite
... and on and on

It can get overwhelming but just keep breaking apart the task until you have a simple thing you can learn.

Also two very important things.

1. Read other people's code and try to understand it. Meaning you can read it and know why it does what it does, copying into an editor and playing with if you have to. THEN THROW IT AWAY. Keep doing this until you can both understand a concept then code it yourself from scratch. If you find yourself copying over and over, back up and see what you need to memorize, learn, or understand. Own it.

2. Make mistakes and code thing WRONG. As long as you don't leave it that way, you will learn a lot more from coding things the wrong way then trying to improve it than you will if you become paralyzed by trying to code it right the first time.

Good luck!

P#20831 2016-05-18 23:35 ( Edited 2016-05-19 03:35)

And read through other people's question threads, they often come with plenty of examples and explanations.

P#20832 2016-05-18 23:37 ( Edited 2016-05-19 03:37)

tyroney: I am lurking here like crazy, checking new posts multiple times a day. I am trying to learn from it as much as I can, but currently a lot of the more advanced (well, more like of medium complexity) stuff goes over my head. I will keep reading through stuff here.

johnesco: That's some good advice. Especially the part about breaking down what you need to do to achieve x. I try doing this with my pong game, and so far it worked pretty well (especially if I have some paper handy where I can break it down by writing/drawing).
I try to break down other people's code, I think this "back engineering" is an awesome learning tool. So far a lot seems to complex for me to grasp, but I think it is because I don't know the functions and syntax very well. I will get better tho ;)

Oh, and what do you mean by coding things WRONG? Just coding and finding out that it doesn't work (or makes crazy bugs?) or coding things in a messy way? Because I do both right now, and I was toying with rewriting/fixing my messy code, but decided against it, because that way I will never finish a game :P.

P#20833 2016-05-18 23:51 ( Edited 2016-05-19 03:51)

>never programmed before
>still 20 times better than me.
>god dammit lua you confusing.

P#21001 2016-05-21 08:20 ( Edited 2016-05-21 12:20)

Thanks for the kind words!

However, I don't think that this is the case. I think it has a lot to do with a mindset. You, as someone who programmed before in other languages, have certain mindset and routines that you expect to work. Those probably don't translate 100% to lua and because of that you think you are just not good at it. I think experienced programmer approach is: it should work, yet it doesn't.

While me on the other hand, I have no frame of reference for what I am doing. Everything is a new uncharted territory. For me the default mindset is - it doesn't work, I need to learn how to make it work.

I come from an art background, so an art analogy would be someone who is great at drawing moving into painting. Those are similar tasks, but have key differences (think in lines vs think in shapes). A person moving from drawing to painting will get much more frustrated at the start, because they can't achieve what they know they can do (let's say a realistic rendering of a human form). While a person who just comes into art through painting is happy if those shapes on canvas are vaguely representative.

The former is still a more skilled artist, just as you are a more skilled programmer. Sure, it might take you little extra time to get into this new (lua) mindset, but once you'll get it, you'll be doing awesome.

There's my random thought for the day.

P#21009 2016-05-21 10:50 ( Edited 2016-05-21 14:50)

Your blog is a fascinating little read. I hope you keep it up!

P#21019 2016-05-21 13:22 ( Edited 2016-05-21 17:22)

https://sectordub.itch.io/pico-8-fanzine-1
Surprised no one suggested the pico fanzines yet.
Really good place to start for Pico-8.
I plan to study these while I attempt a jam entry.

Good to see more new programmers jumping in.
I sure miss the BASIC and QBASIC days though, good times.

P#21021 2016-05-21 14:26 ( Edited 2016-05-21 18:26)

@Lunarex: Thanks! I am definitely planning on keeping up. I will probably slow down with how often I post in a bit in the future (right now I have some more time off, so I can spend more time on learning game dev), but because I am writing about what I am doing (unlike my main blog where I have to come up with topics) I don't think it will be an issue to keep up.

@shadow1w2: Yeah both manual and the zine were my intro do Pico-8. I am curently working on expanding the Squashy from zine #1.

P#21044 2016-05-21 20:42 ( Edited 2016-05-22 00:42)

My PICO-8 code is totally based on my childhood BBC micro BASIC programming days! A hundred IF...THEN statements messily stuck together!

P#21045 2016-05-21 20:44 ( Edited 2016-05-22 00:44)

Hehe, this is more or less me right now, @stefstef. So far I got only as far as tables in programming. Struggling to wrap my head around them now...

..on that topic. Does any one know of some good resources explaining tables (what they are, how to use them etc.) in a newbie friendly way?

P#21064 2016-05-22 01:15 ( Edited 2016-05-22 05:15)

Hey, I'm also a newbie with this thing having found it thru C.H.I.P.

I've been kicking around the idea of picking up PICO-8 for a few weeks when I stumbled upon the fact that I already had access thanks to a humble bundle from years ago! Opps.

As far as tables go, I've only dipped my toe into the PICO-8 code with one of the early fanzine tutorials, but I do know quite a bit JS, PHP, Ruby, etc and the concepts are transferable (NOTE: this if from my initial read of the docs, of which the table section is pretty well laid out. If I'm off base here, or theres major gotchas i missed don't hesitate to tell/yell at me):

Basically a table is a variable that can hold multiple values in it, kinda like a rolodex or a deck of cards. You can either loop thru it and see all the values, and do something with one or more of them, or if you know the value you want you can grab it directly.

I think a simple example could be like an rpg inventory:

Lets say you have a variable called INV that's a table:

 ```INV={} ```

And you tell INV that it should hold some stuff by default, like a length of rope and a potion

 ```INV[1] = "Rope" INV[2] = "Potion" ```

Now down the road in your game you want to make a menu that shows what the items in the INV are, you can loop thru, starting at 1 and continuing till you've gone thru the full length of the table

 ```FOR I=1,INV# DO PRINT(INV[I], 10, 8*I, 15) --PRINT THE VALUE OF THE CURRENT LOOP AT POSITION X10 AND Y8 TIMES I'S VALUE (IF THERE WERE 3 ITEMS IT WOULD BE 8, 16, 24) END ```

You could later add an antidote item to the INV by setting it like this:

 ```INV[INV#+1]="Antidote" --CURRENT INV LENGTH PLUS ONE ADDS THE ITEM TO THE END OF THE TABLE WITHOUT HAVING TO KNOW EXACTLY HOW LONG IT IS ```

You could also have a table full of spells that do a certain number of damage, this time keyed by spell name instead of a numbered index

 ```SPELLS={} SPELLS["FIREBALL"] = 10 SPELLS["HEAL"] = 20 SPELLS["LIGHTNING"] = 10 ```

Things could then be even more advanced if you wanted to store more interesting information about party members.
Say you have a mage and a priest, in your party.

 ```PARTY = {} PARTY[1] = {} PARTY[1]["CLASS"] = "MAGE" PARTY[1]["NAME"] = "BRIAN" PARTY[1]["SPELLS"] = {["FIREBALL"]=SPELLS["FIREBALL"],["LIGHTNING"]=SPELLS["LIGHTNING"]} PARTY[2] = {} PARTY[2]["CLASS"] = "PRIEST" PARTY[2]["NAME"] = "CHUCK" PARTY[2]["SPELLS"] = {["HEAL"]=SPELLS["HEAL"],["LIGHTNING"]=SPELLS["LIGHTNING"]} ```

Now you've got a more advanced data structure for party that has multiple values per party member, and if you decided to make your lightning spell, for instance, more powerful the two members would automatically see the benefit.

Hope that helps.

P#21068 2016-05-22 02:53 ( Edited 2016-05-22 06:53)

Thanks, that helped. It took me a bit of time, but I managed to bend the tables to my will and make them do what I want! It may be a small victory, but victory nevertheless.

The big problem for me was naming convention (especially the syntactic sugar). Once someone explained that to me, it started making sense. I can still see issues with having many interconnected tables. I am a visual person, so it is much easier for me to comprehend things if I can draw them on a piece of paper, or at least visualize it. I think I can easily keep few tables in my head, but once I have 10 or more tables, I might need to draw out the tables and how they connect. Once I'll start implementing the enemy spawner, that I am working on now, into the game proper I might draw the tables and connections out to see how difficult that would be.

Does anyone have any advice how to manage multiple tables like that? Coding practices to make remembering what is where easier? Do any of you draw out your tables to remember where everything is, or is it me just worrying for no reason?

Edit: dandiemer I think there might be an error in your examples with INV[INV#+1]. When I tried using tablename# to get table's length, PICO8 gave me errors, it seems it wants #tablename instead... but it's quite possible I did something wrong and your syntax is correct. ;)

P#21159 2016-05-23 12:26 ( Edited 2016-05-23 16:36)

Nope, you're totally right. # before the variable name to get it's length. That's what I get for typing stuff up at 3am :D

P#21214 2016-05-24 00:18 ( Edited 2016-05-24 04:18)

Hi, Level27Geek. :-) I recently stumbled on your page and am glad that I did. I really enjoy what you are managing to accomplish and I admire your daringness to challenge yourself. I have found myself in the same boat in this final year of my B.A. My background is in design but I would like to learn the whole shebang for my thesis. I was actually wondering if you would be interested in collaborating.

P#44770 2017-09-30 11:55 ( Edited 2017-09-30 15:55)

Hey MEMalguy,

Real life (especially Uni) kinda put a small stop into my programming journey, so I am not sure if I can do a proper collab, but I definitely can help :)

Feel free to send me a PM here or on twitter. I am happy to help :)

Edit: Read through your game idea, it sounds great! The only tricky part (as I see it now) would be making the world large enough in Pico8 to create the "open world" feeling. I guess we can always investigate making the world procedurally instead of using the map data (which also gives you more memory to use for gfx).

P#45038 2017-10-09 21:19 ( Edited 2017-10-10 01:24)