Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Graphics related question

A topic by Ancient World created Jun 08, 2020 Views: 198 Replies: 13
Viewing posts 1 to 6

So I'm looking into ways of doing the visual representation a little more dynamic and I was wondering if there was a way of printing smaller images over bigger ones. Like for instance to show that an object has been picked up or that a door is opened. I see that I can update graphics on command, but I'd like to avoid story X times the same images for very minor changes.


Also and that's more an engine/programmer question, is there a way to not embed images data into the code and html?


Thanks

Submitted

That's a very good question. I noticed that there's provision for sprites in the assets{} section, but it is not documented, so may not be supported. Adventuron will be able to tell you for sure. It sure would be nice to be able to overlay small images on the main image.

Host

Hello,

Good questions.

Firstly, overlays of graphics are most certainly in the roadmap for Adventuron but they won't be ready in the timescale of this jam.

You are correct that set_graphic can be used to change the image to do with a scene, and that is the easiest way to switch state right now (without overlays), but yes, if you have a lot of elements they can become burdonsome.

Now, it really depends on if you are targetting 8-bit as to if you can use what I am recommending from this point forward. For 8-bit games, you certainly cannot use these features. If you are not targetting 8-bit then read on ....

Feature 1 - link graphics as external files (not 8-bit mode compatible):

You can reference graphics in external files. Graphics can be referenced by direct url or by relative reference. If you have web space somewhere, it's easier when developing to reference a http or https address (as your images will not be available on the adventuron classroom server).

Before you upload your finished game to itch, you should change these urls to a relative path (see the sample code at the bottom). When you deploy to itch, make a zipfile of your html file, and all your graphic assets together, and then the main game will reference relative to the outer html file.

https://adventuron.io/documentation/cookbook.html#LinkingExternalMedia

Feature 2 - Dynamic graphics (not 8-bit mode compatible):

You can use dynamic graphics to create rules for selecting graphics. If you have 3 dynamic elements of your location graphic that are either on or off, then the number of images you'd need to supply would be 8. It's bothersome, but it's doable, and not too much extra work. Overlays will make this a LOT easier but they won't be ready.

https://adventuron.io/documentation/cookbook.html#DynamicGraphics

Feature 3 - Precache graphic (not 8-bit mode compatible):

Referencing graphics that are not embedded in the html file can lead to pop-in, as there will be a slight delay as the graphics are asynchronously accessed via the internet. To eliminate this pop-in, you can tell Adventuruon to pre-load all linked resources with the following configuration setting (at top level):

game_settings {
   precache_strategy = precache_all
}


------

Full sample
game_settings {
   precache_strategy = precache_all
} assets {    graphics {       // Contains the rule of which graphic to choose (returns a string id of the graphic to pick)
      // boolean_expression ? when_true : when_false       hallway : dynamic_graphic {(
         is_hallway_lit ? (is_hallway_door_open ? "hallway_lit_door_open" : "hallway_lit_door_closed")
         : (is_hallway_door_open ? "hallway_unlit_door_open" : "hallway_unlit_door_closed")
      )}       hallway_lit_door_open : png "images/hallway_lit_door_open.png";
      hallway_lit_door_closed : png "images/hallway_lit_door_closed.png";
      hallway_unlit_door_open : png "images/hallway_unlit_door_open.png";
      hallway_unlit_door_closed : png "images/hallway_unlit_door_closed.png";
   } }


Regards,

Chris

Thanks this will simplify my life, and this is a confirmation that I need to read the cookbook. I don't think I'll go for a 8bit compatible game at that point, since I'm not a Spectrum fan... the day the export to Amstrad works with graphic support, that will be another story :)

Host

These things can be arranged.

Submitted (1 edit)

I chose a very low graphic resolution: 32 x 10 px; I'm going to have a hundred of them, can I stretch them in the code?

My loading screen:

Host

Adventuron will stretch them automatically, you don't need to do anything in the code.

Targetting 8-bit too?

Submitted

Yeah, I'll try. I will review the DAAD documentation (I already used inPAWS (works well under Linux), so I know a little bit about the principle). I'm not going to code right away, and I had failed to compile from Adventuron to DAAD under Linux. For now, I have my graphics and level design to finish!

Submitted

A hundred of them! Crikey! I hope it's not one per room.

Submitted

Two to four per frame, often.

Submitted

I need to export my many Gimp layers individually. The solution to export in .ora format works, but the layer names are not kept. If someone has a solution?

Submitted

Great, I hadn't even seen that the .ora format produces a stack.xml file that contains all the layer names. I'll be able to script and give the correct names to the 140 image files!

Host

140!!

Submitted (1 edit)

Yeah, I'll cut a few, but I'll stay above 130. Luckily the renaming script works, and I can import the images into Advanturon with a .zip file.
I don't understand why .png compression with Gimp is so bad; https://compresspng.com/ seems to be the most efficient, but it only takes twenty images at a time.