1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Suggestions regarding tiles and blob spawning

Discussion in 'Suggestions & Ideas' started by Shadowblitz16, Sep 12, 2017.

?

Do you think this is a good idea

  1. Yes

    4 vote(s)
    57.1%
  2. Possibly

    1 vote(s)
    14.3%
  3. No

    2 vote(s)
    28.6%
Mods: Rainbows
  1. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    Updated 9/12/2017

    I have some suggestion regarding tiles and blobs spawning from png map
    - please move existing tiles like dirt, castle, and wood to a script. (so they are not hard coded)
    - please move existing liquid tiles like water to a script. (so they are not hard coded)
    - please make alpha pixels and opaque pixels works together.
    - please split up tile loading blob loading, tile offsets, and tile behavior into separate scripts.
    - please add colors for all background, rotations, and teams
    - please change SColors to u32's and change if statements to switch statements (this will make it easier to read and expand the code)

    this is another suggestion for modding but I think it would be nice because it would be easy to adapt existing code to and wouldn't break anything if implemented correctly.
     
    Last edited: Sep 12, 2017
    Vamist likes this.
  2. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    I'm having some trouble understanding what exactly is the challenge and what you are really proposing. It would perhaps help in understanding the problem, if you could describe a little closer what you are trying to do.

    There's a lot of different things read from a map. Tiles, blobs, markers etc. I get the impression you think these should be divided somehow. There aren't really any clear lines between these and how they are handled though. What they have done, is pull out what's the basics for loading a map in KAG, and add separate derivative loaders for game mode specific stuff. It's not a simple thing to generalize any more than what has been done, without having to imagine every possible mod someone could decide to make. It's not a hard thing to separate parts of the script into separate files, but why? It's already packed together in a fairly meaningful way, in one place.

    The other points you list, I don't get at all.
     
  3. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    the point is it would make it easier to find things and would make modding easier
    right now everything is stuffed in the BasePNGLoader.as.
    there are separate scripts for gamemode objects but thats it.

    the points are petty easy to understand..
    - move hardcoded tile and liquids into their own scripts as well as their behavior like falling, damage, and collision.
    - make Skinney's alpha behavior not set rotation and teams but offset them according to their color.
    - add all missing combinations of items. (for example there might be green wooden platform that is rotated 90 and in on a stone background).
    - also change SColors to u32s so that we can use switch statements (this will make code easier to read)
     
  4. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    Having "only" one place to look sounds good to me. But, I believe we're thinking about different things, since you mention behavior, which isn't at all part of the map loading process, and "hard coded" values.

    I get the impression that you just want to find everything about ladders in one place, for instance, both how it's represented in a map and how the blob behaves. In this case, a new "LoadLadder" file that is included in the loader script instead. I think this is a matter of taste. You would have to create an awful lot of files, and most of them would look very alike and contain very little. I'm not overfly fond of the chosen approach myself - there's something in me that objects (hah!), but really, it's pretty efficient (looking past some obvious "flaws").

    Using a simple bitmap file for maps, is a pretty elegant solution, which is adequate for basic KAG stuff. The use of the alpha channel and bit-wise operators is a clever one, but not the most map designer friendly, that's for sure. If I get you right, you would rather set this using other colors. It's certainly easier, but on the other hand all the different colors (palette) you have to keep track of would get increasingly complex. It's quite complex already. I think that any more complexity would make the current bitmap/PNG solution increasingly inadequate, leading ultimately to custom formats and map editors. I'd much rather see the use of a format that allows multiple layers. One layer could contain team information, while another could contain orientation, for example. Colors could possibly have completely different meaning depending on the layer. You could, for instance, be allowed to create as many different teams as you want, only within the limits of the color depth. It would make some of these situations a little easier to deal with, and certainly a lot more flexible.

    Things like switch statements being easier to read or not, is highly subjective, and ultimately unimportant. Since the first letter is a capital letter, I'm guessing means it's a C type of some sort, in the engine. Substantial changes are unlikely to be made at this point, and especially engine-side ones. It can be done in a mod. I don't mean to discourage, but it's the reality.
     
  5. Fuzzle

    Fuzzle Grand Grumbler

    Messages:
    296
    Have you seen `uint SColor.color`?
     
  6. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    @Vermilicious I don't mean move the blob logic to the folder, just the blob loading in the png map.
    the tiles and liquids are what I mean when put there behavior in a different script.
    @Fuzzle the whole point of changing SColor to uint would be for switch statements as they are easier on the eyes and are overall easier to read
    storing the const colors as uints would just be easier.
     
  7. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    No. Things are slower in script. These things are working fine as-is. This would be a performance pessimisation for no improvement in functionality for everyday users, at a large implementation cost to us (especially the fire/water).

    If you're looking for examples of a full custom tile implementation, Trench Run is a good place to start. @GoldenGuy seems like he's done a lot of that kind of thing too. We understand that stuff "living in the engine" isn't ideal for modders, but we're not willing to further compromise performance. If there's functionality missing that you'd like, that can usually be added. We don't need to do huge modifications to the core game to accomplish that.

    No way. This is a pointless change; readability is debatable and switches are more susceptible to programmer error. Reformatting some huge piece of code just because some modder disagrees with a code style choice is not something I'm interested in, personally.

    As @Vermilicious said - this can be done in mods. If you want, you can build your own totally separate map loader and use that. It doesn't have to be based on existing code at all.
     
  8. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    ok thanks for the reply @Geti
     
    Geti likes this.
  9. GoldenGuy

    GoldenGuy Bison Rider Tester

    Messages:
    105
    its still not possible to change collapse sounds and effects for custom tiles, i did a custom colapse system, but i wanna keep default one because it looks better :(
    --- Double Post Merged, Sep 13, 2017, Original Post Date: Sep 13, 2017 ---
    + stuff like gold sparks would be a good thing to un hardcode, so mdders could add more cool effects, like upload_2017-9-13_13-45-52.png this corner
     
  10. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Do collapse tiles even have custom sounds for existing tiles? you could modify the default sound files probably, though it might not work out of mods/...

    Custom collapse system is probably how you'd have to go if you want much more control there. The collapse system is its own totally separate beast (written by MM in a week in a hurry) and exposing more of the "guts" of it is not really something I'm too interested in.

    Gold sparks is a pixel-based very special case thing. That kind of auto-tiling could be achieved by changing the tilemap; definitely not cheap/easy, but not impossible.
     
  11. GoldenGuy

    GoldenGuy Bison Rider Tester

    Messages:
    105
    The thing is, i want to make it look like default kag stuff, by recreating something from scratch i cant keep normal kag look :(
     
Mods: Rainbows