New Game Creator

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
Lee Bee
Dynamite Dan
Posts: 1494
Joined: Sat Nov 16, 2019 11:01 pm
Location: Devon, England
Contact:

Re: New Game Creator

Post by Lee Bee »

AndyC wrote: Thu May 23, 2024 2:34 pm One option for quickly applying tile attribute changes would be to allow multi select.
Presumably you're talking about selecting multiple squares in the room to edit (perhaps by holding shift), so you can then change the colour or tile graphic of every square at once? Not only is this a good idea, I'd say it was absolutely essential. Otherwise you've no way to quickly compare how your whole room looks in various colours.

(Then again, I still think assigning default colours to tiles is the way to go, letting you make instant universal colour changes across the game map!)
AndyC wrote: Thu May 23, 2024 2:34 pm allow them to be viewed grouped by a given attribute or attributes (i.e. all solid blocks together)
Sometimes, an item of background scenery may comprise both solid and non-solid tiles (eg: solid plant pot with non-solid leaves). Therefore, the two types of tile should not be forcibly separated or you're breaking apart items of scenery. Though options are always nice!
Last edited by Lee Bee on Thu May 23, 2024 3:04 pm, edited 1 time in total.
User avatar
ParadigmShifter
Dynamite Dan
Posts: 1094
Joined: Sat Sep 09, 2023 4:55 am

Re: New Game Creator

Post by ParadigmShifter »

Ctrl is multi select surely ;) Shift is range select (i.e. click on item in a list, then shift click on another item to select all items in that range).

The Unity scene editor is my go-to reference for these sort of things, it's a very good editor. That has a hierarchical scene view and clicking on a specific type of element gives you a property page for that objects specific type.

I agree boolean properties should be mostly non-exclusive (so checkboxes instead of radio buttons/drop down list).
User avatar
Lee Bee
Dynamite Dan
Posts: 1494
Joined: Sat Nov 16, 2019 11:01 pm
Location: Devon, England
Contact:

Re: New Game Creator

Post by Lee Bee »

Never even heard of Unity. :oops:
ParadigmShifter wrote: Thu May 23, 2024 3:04 pm Ctrl is multi select surely ;) Shift is range select
I was thinking both Ctrl and Shift. Though for bulk colour edits, the one you'd probably use most would be Shift, to select a big rectangle with just 2 clicks. You could also allow drawing a rectangle with the cursor.
pgregory
Drutt
Posts: 33
Joined: Mon Apr 15, 2024 5:18 pm

Re: New Game Creator

Post by pgregory »

Thanks everyone, lots of good ideas, some I've already considered, some new, I'll make a note of them all and see what falls out in the wash.

Cheers
User avatar
ParadigmShifter
Dynamite Dan
Posts: 1094
Joined: Sat Sep 09, 2023 4:55 am

Re: New Game Creator

Post by ParadigmShifter »

Lee Bee wrote: Thu May 23, 2024 3:10 pm Never even heard of Unity. :oops:


I was thinking both Ctrl and Shift. Though for bulk colour edits, the one you'd probably use most would be Shift, to select a big rectangle with just 2 clicks. You could also allow drawing a rectangle with the cursor.
Unity engine is a very popular game engine, although a bit less popular now they decided to change the rules for how you have to pay (used to be royalty-free if you don't earn $X thousands of dollars from the game or something). It's probably the 2nd most popular after Unreal.

The Unity scene editor is very good though (I think Unreal ripped it off a lot as well).

Last PC game I developed was done in Unity (in C#).

Godot looks like it is trying to muscle in and take bites out of Unity though.
AndyC
Dynamite Dan
Posts: 1466
Joined: Mon Nov 13, 2017 5:12 am

Re: New Game Creator

Post by AndyC »

Lee Bee wrote: Thu May 23, 2024 2:59 pm Presumably you're talking about selecting multiple squares in the room to edit (perhaps by holding shift), so you can then change the colour or tile graphic of every square at once? Not only is this a good idea, I'd say it was absolutely essential. Otherwise you've no way to quickly compare how your whole room looks in various colours.
I rather meant "attribute" in the more programming sense. I e. things like "solid". So you could group all the solid tiles together then just drag the ones you wanted into the "not solid" category. And preferably do multiple groups, so you could group by "solid" and "destructible" (or whatever game specific attributes you create) and get the four permutations as different groups.
User avatar
ParadigmShifter
Dynamite Dan
Posts: 1094
Joined: Sat Sep 09, 2023 4:55 am

Re: New Game Creator

Post by ParadigmShifter »

"Properties" is probably the programming term you are looking for then.

What Unity does is if you multi select several objects of the same type, they all have the same property page and clicking a checkbox on the property page applies it to all selected objects.

If some properties on the selected objects are different it shows the properties in grey rather than normal font weight. If you then click a property it still applies it to all (and then it changes the font to boldface I think?).

EDIT: Consistency lol ;)

You need a good undo system for that to work well though (I suggest the Command Pattern for that if you don't know about that).

See

https://en.wikipedia.org/wiki/Command_pattern#Uses

which has a brief note about multi-level undo.
Last edited by ParadigmShifter on Thu May 23, 2024 4:09 pm, edited 1 time in total.
AndyC
Dynamite Dan
Posts: 1466
Joined: Mon Nov 13, 2017 5:12 am

Re: New Game Creator

Post by AndyC »

Probably. I've just had my mind in XML mode all day...
pgregory
Drutt
Posts: 33
Joined: Mon Apr 15, 2024 5:18 pm

Re: New Game Creator

Post by pgregory »

ParadigmShifter wrote: Thu May 23, 2024 4:06 pm You need a good undo system for that to work well though (I suggest the Command Pattern for that if you don't know about that).

See

https://en.wikipedia.org/wiki/Command_pattern#Uses

which has a brief note about multi-level undo.
Undo is already implemented...

User avatar
ParadigmShifter
Dynamite Dan
Posts: 1094
Joined: Sat Sep 09, 2023 4:55 am

Re: New Game Creator

Post by ParadigmShifter »

Nice one, multi level undo I hope? (That's why I posted link to the Command Pattern that's the best way IMO to implement multilevel undo).
pgregory
Drutt
Posts: 33
Joined: Mon Apr 15, 2024 5:18 pm

Re: New Game Creator

Post by pgregory »

ParadigmShifter wrote: Thu May 23, 2024 7:40 pm Nice one, multi level undo I hope? (That's why I posted link to the Command Pattern that's the best way IMO to implement multilevel undo).
Depends what you mean by multi-level undo. It has an (effectively) infinite undo buffer if that's what you mean. It doesn't do "VIM" style forking though. If you undo back say 4 steps, you can redo those 4 steps, until you do something that changes the data, in which case a new undo is added to the tail of the buffer, and the 4 steps you could redo are lost.
User avatar
ParadigmShifter
Dynamite Dan
Posts: 1094
Joined: Sat Sep 09, 2023 4:55 am

Re: New Game Creator

Post by ParadigmShifter »

pgregory wrote: Thu May 23, 2024 8:11 pm Depends what you mean by multi-level undo. It has an (effectively) infinite undo buffer if that's what you mean. It doesn't do "VIM" style forking though. If you undo back say 4 steps, you can redo those 4 steps, until you do something that changes the data, in which case a new undo is added to the tail of the buffer, and the 4 steps you could redo are lost.
Yeah that's what I meant. Forking is a lot more complicated, can be done with Command Pattern if you use a tree instead of a queue though I think - most apps don't do that.

What annoys me is stuff like notepad where you only have a 1 level undo!
User avatar
Lee Bee
Dynamite Dan
Posts: 1494
Joined: Sat Nov 16, 2019 11:01 pm
Location: Devon, England
Contact:

Re: New Game Creator

Post by Lee Bee »

ParadigmShifter wrote: Thu May 23, 2024 8:13 pm What annoys me is stuff like notepad where you only have a 1 level undo!
It pains me to think anyone is still using Notepad. Notepad2 is infinitely better.
Last edited by Lee Bee on Fri May 24, 2024 11:09 am, edited 2 times in total.
pgregory
Drutt
Posts: 33
Joined: Mon Apr 15, 2024 5:18 pm

Re: New Game Creator

Post by pgregory »

Lee Bee wrote: Fri May 24, 2024 11:07 am It pains me to think anyone is still using Notepad. Notepad2 is infinitely better.
NeoVim every day of the week!
User avatar
Lee Bee
Dynamite Dan
Posts: 1494
Joined: Sat Nov 16, 2019 11:01 pm
Location: Devon, England
Contact:

Re: New Game Creator

Post by Lee Bee »

pgregory wrote: Fri May 24, 2024 11:09 am NeoVim every day of the week!
NeoVim is perhaps the best text editor for programming, but it's not really a replacement for Notepad, which is meant to be a small, fast, simple text editor that works out of the box with no learning required. Notepad2's installer is 300k (which seems pretty bloated by Speccy standards) but NeoVim is over 10 megs, which tells you a lot about the complexity of the two programs :-)
User avatar
ParadigmShifter
Dynamite Dan
Posts: 1094
Joined: Sat Sep 09, 2023 4:55 am

Re: New Game Creator

Post by ParadigmShifter »

I only use Notepad for very basic stuff. Like taking notes ;) Notepad if I want a few more features.

I use Visual Studio Express as my programming editor (so speccy Z80 code), and for Windows/Unity C# and C++, since I used DevStudio for years. The debugger is good for C++ and C#, although you can't use data breakpoints for C#, sadly. Before that I used Brief (in DOS days). Or Boxer on OS/2 which was a nagware version of Brief.

Vim is the editor where if you accidentally open a file with it by mistake (set up as default for certain file types in Unix) where you have to phone up one of your colleagues to ask them how to close it lol ;) EDIT: If I had to guess I would say Escape then :q <enter>

Can't remember what I used in Unix to edit shell scripts and the like, was a while ago I last had to use Unix.
AndyC
Dynamite Dan
Posts: 1466
Joined: Mon Nov 13, 2017 5:12 am

Re: New Game Creator

Post by AndyC »

ParadigmShifter wrote: Thu May 23, 2024 8:13 pm What annoys me is stuff like notepad where you only have a 1 level undo!
Notepad has multi level undo. Still doesn't have a redo though, which is a mildly annoying.
User avatar
ParadigmShifter
Dynamite Dan
Posts: 1094
Joined: Sat Sep 09, 2023 4:55 am

Re: New Game Creator

Post by ParadigmShifter »

Version of Notepad I use does not have multilevel undo (although it seems to wait a bit before committing the text to the buffer, so if you type a few characters it undoes them all). Redo is same key as Undo (Ctrl-Z). I'm using Win10. Maybe they changed it for Win11?

Notepad is just a bog-standard Windows edit box with a few menu options thrown in. It used to limit the file size to 64K! That probably changed when Windows became based on NT (NT3, NT4, WinXP and all later versions IIRC) rather than DOS (like Win3.1, Win95/98, probably the crap one after that as well).

WordPad does have multilevel undo IIRC. They are retiring WordPad soon I think and it won't be in new releases of Windows.

EDIT: Looks like my version of notepad anyway is just a basic (multiline) Edit control, RichEdit2.0 added multilevel undo

Remarks
Edit controls and Rich Edit 1.0: An undo operation can also be undone. For example, you can restore deleted text with the first EM_UNDO message, and remove the text again with a second EM_UNDO message as long as there is no intervening edit operation. << That's how my version of Notepad works.

Rich Edit 2.0 and later: The undo feature is multilevel so sending two EM_UNDO messages will undo the last two operations in the undo queue. To redo an operation, send the EM_REDO message.

Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.

https://learn.microsoft.com/en-us/windo ... ls/em-undo

EM_REDO is only for RichEdit controls which I believe my version of Notepad does not use (not gonna use WinSpy though to find out if it is just a basic Edit control).

Bit off topic though ;)
AndyC
Dynamite Dan
Posts: 1466
Joined: Mon Nov 13, 2017 5:12 am

Re: New Game Creator

Post by AndyC »

ParadigmShifter wrote: Fri May 24, 2024 2:04 pm Version of Notepad I use does not have multilevel undo (although it seems to wait a bit before committing the text to the buffer, so if you type a few characters it undoes them all). Redo is same key as Undo (Ctrl-Z). I'm using Win10. Maybe they changed it for Win11?

Notepad is just a bog-standard Windows edit box with a few menu options thrown in. It used to limit the file size to 64K! That probably changed when Windows became based on NT (NT3, NT4, WinXP and all later versions IIRC) rather than DOS (like Win3.1, Win95/98, probably the crap one after that as well).
Yeah, basically none of that is still true in Windows 11. Notepad is a fairly basic editor but it supports more than just a Win32 edit control - I believe it's a WPF app these days. It has tabbed editing and auto save etc.

And apparently I was wrong, there is a redo on Ctrl+Y it just not in the menus or mentioned anywhere.
User avatar
ParadigmShifter
Dynamite Dan
Posts: 1094
Joined: Sat Sep 09, 2023 4:55 am

Re: New Game Creator

Post by ParadigmShifter »

WPF ugh :x All that XML lol ;)

Dunno why anyone would write a Windows app in WPF these days when C# is miles better. If performance is an issue you can just write a DLL in C++ or embed a DirectX canvas (or an openGL canvas). WPF is probably better than MFC :cry: (dunno if they even support that anymore lol). And WTL - which was going to be a more modern and better version of MFC - they never got around to even finishing properly!

Anyway if Notepad has changed for the better in Win11 maybe that's why they are retiring Wordpad.

I'll stop going on about Notepad now then ;)
pgregory
Drutt
Posts: 33
Joined: Mon Apr 15, 2024 5:18 pm

Re: New Game Creator

Post by pgregory »

Update teaser, as the next video will be a little late, lots of things happening...

https://ko-fi.com/post/Upcoming-feature ... -Y8Y8YQZRU
pgregory
Drutt
Posts: 33
Joined: Mon Apr 15, 2024 5:18 pm

Re: New Game Creator

Post by pgregory »

Following on from the short teaser last week, this video update covers in a lot more detail the changes necessary to make that happen.

In short, different sprite sizes and types, and more importantly, object spawning. A major step towards usability. I'll be preparing for pre-alpha/early access testing in the next month or two, so if you're interested, pop over to the Ko-Fi page and drop me a message, let me know why you'd like to be a tester.

https://ko-fi.com/post/Update-Video-11- ... -U7U1YVWQ0

Image
User avatar
Lee Bee
Dynamite Dan
Posts: 1494
Joined: Sat Nov 16, 2019 11:01 pm
Location: Devon, England
Contact:

Re: New Game Creator

Post by Lee Bee »

Love the montage image at the start of the video! :-)

Forgive my ignorance but I'm struggling to work out why sprites are now divided into 'sprite sheets'. Is this just to group sprites according to their size? Or is there some other reason?
pgregory
Drutt
Posts: 33
Joined: Mon Apr 15, 2024 5:18 pm

Re: New Game Creator

Post by pgregory »

Lee Bee wrote: Mon Jun 03, 2024 6:00 pm Forgive my ignorance but I'm struggling to work out why sprites are now divided into 'sprite sheets'. Is this just to group sprites according to their size? Or is there some other reason?
It's partly the size thing, but also the data organisation. All sprites in a sprite sheet will be the same size, have the same configuration etc. and this reduces memory overload, you don't need to store a size and type information for every single sprite. But also, due to the way the sprites are stored and rendered, there has to be some "blank" space that can be used to shift the sprites to pixel positions, and when all similar sprites share a sheet, this blank space can be shared to a degree, reducing overhead further.
User avatar
ParadigmShifter
Dynamite Dan
Posts: 1094
Joined: Sat Sep 09, 2023 4:55 am

Re: New Game Creator

Post by ParadigmShifter »

Dunno how OP is doing stuff but I always like to lay my sprite data out into 256 byte "pages".

Advantages of that are:

If you render multiple sprites from the same page, you only need to set the high byte (sprite page byte) once and then just set the low byte for another sprite on the page

If you know your data does not span a 256 byte boundary you can use INC L (or INC E if using DE) instead of the slower INC HL or INC DE to point to the next byte of the data, since you know the high byte does not change once set.

You can also do cleverer stuff than that like make each line of a sprite be offset by 256 bytes instead of <sprite width> bytes which means when moving to the next line of data you can just do INC H (or INC D) instead of LD A, L : ADD <sprite width> : LD L, A

EDIT: Ok OP is not doing exactly that but maybe some parts of it are true I guess.
Post Reply