Engine: 5SSWtBTz
Gamestarter: m84mxdx5
Warning: The pastebins will change, and only the github is up to date anytime!
Github: it is here
Since when are frameworks inherently slow? If you use a good enough framework, it'll hopefully make optimisations that actually *improve* performance, as well as making things easier for the developer.CC is not very fast. Using a framework is a bad idea for the performace. If you look at another game engine, choose a engine in lua.
Making a game engine in CC is a bit more useful than making an OS, though, both are good at teaching various aspects of programming and Lua. Perhaps the OP just wants a project to work to guide their learning.This is hard to answer without knowing why you want to make a game engine?
Making a game engine in CC is a bit more useful than making an OS, though, both are good at teaching various aspects of programming and Lua. Perhaps the OP just wants a project to work to guide their learning.-snip-
This is hard to answer without knowing why you want to make a game engine?
If you're making something within CC, there are a few engines, although I've never used them so can't comment on their usability. It's entirely up to you whether you make your own.
If you're making something for the real world, don't use CC. If you want to roll your own engine, it won't be simple, so use something else like Love or Godot (or UE4 which is amazing).
If you're doing it for the practise/fun, then of course make an engine. CC is a good start because of its simplicity, although the graphical limitations can be annoying.Since when are frameworks inherently slow? If you use a good enough framework, it'll hopefully make optimisations that actually *improve* performance, as well as making things easier for the developer.CC is not very fast. Using a framework is a bad idea for the performace. If you look at another game engine, choose a engine in lua.
The issue is CC being slow. If you're wanting to do advanced 3D rendering and physics and AI, it's clearly not a good choice. However, if you're wanting to use CC at all, it's unlikely those will be on the TODO list, and it's still remarkably fast (you can add numbers together a few hundred million times in a second on my laptop)
I thought about the text adventure thing, but i cant realy see were to start. There are many text adventure genres, like DOS, RPG, survival and so on.
I am making a game engine, but if i make an engine specified on a game the engine is (in my opinion and in CC) useless. I have started the topdown thing:I thought about the text adventure thing, but i cant realy see were to start. There are many text adventure genres, like DOS, RPG, survival and so on.
Are you making a game engine or a game? Game engines are a framework which shouldn't make any assumptions on what the game will be about. Game engines are not something that are playable on their own (I.e. the require a game to be implemented on top of them).
You can make a game without making an engine (sort of, you technically make an engine which is specialised to that game), this may be more interesting and rewarding.
how can i make animated gifs in imgur?just give an image link that is an animated picture (such as .gif or .gifv)
My engine has animation support. You can create one easily with making a sprite with a table with images as image.Ideally, the engine itself would handle things like animations, but I guess that approach works too.
If you want to make animated gifs, use something like ShareX. You can record a region of your screen and it automatically uploads it so you can just paste a link in here.
I have a good program for screen capturing and i can convert it to gif.Oh, right, linux. I think there are some tools but I never had much luck with them. If you dual-boot, you could get it on windows and boot into windows to record stuff. It's a pain but might be worth your time for some things.
I decided to make a main loop, in wich the draw, update and at the beginning load, are called. I decided it because it is hard to make animation while an event listener is waiting.
Is there any brown-white color in the palete?
But i thought it only counts the time since the timer is started? How does this work with events?If you want to capture within ComputerCraft, specifically, there's always RecGif.I decided to make a main loop, in wich the draw, update and at the beginning load, are called. I decided it because it is hard to make animation while an event listener is waiting.
The idea is to have your event listener listen for timer events, as generated by os.startTimer().
Thanks. I will use the parallel or coroutine api, so i can make an event listener whilst everything else can do what it wants to do. I always think of making a move() function for sprites, which moves the sprite if you press the up/down/left/right key. But it doesnt feel right…I think he meant that you have an event listener that handles all events, then queue a timer every 0.05 seconds. The event handler would then get the timer event and update whichever animation needed updating.
To make things into links, highlight it and press the link button in the editor. It looks like this:
But how can the timer help me prevent the sleeping which is created by the timer listener? :(/>Eurgh, coroutines are one way of doing it, but I'd advise against it. Everything I've ever made in a game that would've had some kind of parallelism I handled with event callbacks, and I can't think of any reason you'd need more than just that. For example, imagine a 2D platformer. Every frame, you fire an "update" event, which does physicsy stuff like gravity, collisions, and so on. Then a "draw" event, which draws stuff. When the player presses one of WASD, fire a "move" event with the direction. Animations can be handled with timer events.
Looking at the wikipedia definition of a sprite, I'd say you should be able to reposition them. I guess look at other engines and see how they handle it. I wouldn't tie it directly in with key presses though.
The Programs section (and all sub-sections) are for completed code only. Discussions generally go in General. You could probably use GitHub issues to discuss things too.
Wow, i acutally did it! I can now run programms withI decided to make a main loop, in wich the draw, update and at the beginning load, are called. I decided it because it is hard to make animation while an event listener is waiting. There will be an key_pressed(key), a draw() and a update(dt) function like in löve –> https://love2d.org/wiki/love.run.
playgame <game>
. In the game i have to load the engine. I can declare the load, update, draw and many other functions. You can make event callbacks which are called when an event is called in the main loop.Can you short explain what a buffer does, english is not my first language :(/> .Just wanted to mention you should start with a screen buffer if you're making an engine for more advanced games in CC. Good luck coding!
A buffer is a place where where things are temporarily stored before being moved elswhere or processed. A screen buffer, in CC, is usually a terminal object and it is used to generate the frame before blitting, or 'pushing', the entire buffer to the real screen.Can you short explain what a buffer does, english is not my first language :(/> .Just wanted to mention you should start with a screen buffer if you're making an engine for more advanced games in CC. Good luck coding!
A buffer is a place where where things are temporarily stored before being moved elswhere or processed. A screen buffer, in CC, is usually a terminal object and it is used to generate the frame before blitting, or 'pushing', the entire buffer to the real screen.Can you short explain what a buffer does, english is not my first language :(/> .Just wanted to mention you should start with a screen buffer if you're making an engine for more advanced games in CC. Good luck coding!
-snip-
Well explained! :)/>
Just one more thing to add:
Why you want to use a buffer: haveing a way to have a UI without any flickering (UI parts being drawn over each other really fast). You would want everything you would want to be loaded on a screen to be loaded into the buffer and afterwards the buffer should be drawn on the screen. You would need to create your own functions for paintutils.drawFilledBox() etc.
There's also the window API, although it's notoriously slow so maybe make your own. Seeing the code behind it might help however.
I'm fairly sure it stores 3 strings per line: one for characters, and two for colours. This works quite well if you're drawing longer lines and makes blitting to the screen a bit faster, but if you're drawing lots of individual/smaller groups of characters (something I'd suggest happens a lot in a game), that means a lot of string manipulation, which Lua doesn't like so much. Compared to an array of pixels, where changing a pixel is just a settable instruction per component, the multiple calls to string functions (albeit native functions) is much slower.I honestly don't see that it has that much room for improvement. My only gripe is that you can't query window content in any way - not that that's something I even want to do on a regular basis.There's also the window API, although it's notoriously slow so maybe make your own. Seeing the code behind it might help however.
I can't remember the topic title at this point.
I wanted to change the topic title to something like things i have to know if i want to make a game engine, but i dont know how to do this…
Have you actually tested the speed difference betweeen the two options? String-per-line allows you to blit directly as soon as the buffer is instructed to draw. String-per-character has to either concatenate (width - 1) * 3 times per line or it has to draw by individual characters (extremely slow). I seem to recall speed tests supporting string-per-line, but I can't remember the topic title at this point.
String-per-character has to either concatenate (width - 1) * 3 times per line or it has to draw by individual characters (extremely slow)
Internally, table.concat is still length - 1 concatenation operations.