Page 1 of 1

Game Agnostic Chicken Defense (Some assembly required)

Posted: 08 Sep 2016, 03:19
by Forboding Angel
Ok, so there is a repo for it here: https://github.com/Spring-Helper-Projec ... en-Defense

I have abstracted everything that I can (unittextures doesn't play nice with being in subdirectory due to the fact that upspring doesn't seem to care for it).

Ideally, the readme will explain to you how to set it all up. The text files contain copy-pasta snippets that you can use to dump it all into your game. The point here is to make it easy to add, and easy to remove. I've removed pretty much all the BA stuff and I've moved everything that I could to a subdirectory for easy storage.

Some of this might be broken (shouldn't be (tm)), but it would be cool if I could get some people who are more experienced in dealing with chickens to help me get it to the point to where it will work upon implementation.

Those of you with projects... Can you help me out? As it isn't a straight up drop in (implementation shouldn't take more than 5 minutes though), it must be implemented into a game to test. That's a crappy downside, but due to the expansive nature of chickens, it is a necessary one.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 08 Sep 2016, 14:27
by Karl
thanks for that looks like it will come in handy. I will be looking into it later.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 09 Sep 2016, 02:06
by Forboding Angel
The unitdefs are still a hot mess. I'm going to end up spending a lot of time just unfucking them, so yay to that.

I'm going to try to embed it in BA today and see if it works. Ideally if I fix any errors it gives with BA, it should work for anything else.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 09 Sep 2016, 03:02
by Forboding Angel
There seem to be no more errors in BA, so give it a shot in your own projects and see if it works.

The defs are still a travesty, but it should work(tm) properly.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 09 Sep 2016, 08:47
by Forboding Angel
[f=-000001] Error: Failed to load: chicken_spawner_defense.lua ([string "LuaRules/Gadgets/chicken_spawner_defense.lu..."]:286: attempt to index field '?' (a nil value))

That is the error I am getting in evo. As you can see here:
https://github.com/Spring-Helper-Projec ... e.lua#L286

It is having issues with the chickendeftypes table that should be available from the config that is loaded at the top of the gadget.

I need to know if any other games are having this issue, but I don't know what games are compatible with spring 103. Is Metal factions 103 capable?

Edit: Yes it is and I was able to get chickens working it it correctly.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 10 Sep 2016, 05:51
by Forboding Angel
Updated evo's gadget handler (was using one from 101) and the callins list, which fixed the issue that evo had.

Next I'm going to go through and unfuck the defs (and oh my god are they shit).

So you can use this as is with few to 0 issues, but I want to put some more work into making it more user friendly before I'm happy with it.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 10 Sep 2016, 08:34
by Karl
Alright, thanks for the effort man.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 10 Sep 2016, 19:23
by raaar
I haven't tested MF extensively with 103.0 yet, it's on my todo list.

The idea is nice, but apparently you can't really have game-agnostic chicken defense. I guess you could call it "chicken defense package that can be easily customized to fit most games".

Maybe it'd be nice if we could have an "addons" directory within the game package where we could place sdd directory trees for such things like chicken expansions, without its files having to be mixed up with the game files in each of the existing subdirectories. Maybe it's not worth the trouble.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 10 Sep 2016, 20:04
by Forboding Angel
raaar wrote: Maybe it'd be nice if we could have an "addons" directory within the game package where we could place sdd directory trees for such things like chicken expansions, without its files having to be mixed up with the game files in each of the existing subdirectories. Maybe it's not worth the trouble.
Yes plox

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 10 Sep 2016, 20:46
by Silentwings
You can just make one sdd depend on another via modinfo.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 10 Sep 2016, 21:20
by Forboding Angel
But the second is outside of the first. We are talking about add-ons that are in addition form that are still inside the structure of the main game. That would be very nice.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 10 Sep 2016, 22:35
by Silentwings
"addition form" means nothing precise to me - there are both mutators and libraries. The situation is that:

If it has lua entry points of its own -> own archive/sdd is needed; using a subdir is not practical and would cause the VFS to go bananas.
If it does not -> you can already create your own addons subdir and call files from within it e.g. https://github.com/SpringCabal/LD35/tree/master/libs.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 11 Sep 2016, 12:53
by gajop
I'd advise you avoid the name "addons", since it might be confusing as this is what players might install to modify your game.

What you mention sounds a lot like libraries, and even though Silentwings provided a decent example, I suggest you check Chobby, as that's the best example currently.
In particular, it's worth looking at the liblobby library, which has a pretty decent format: https://github.com/Spring-Chobby/Chobby ... s/liblobby . Each library is loaded like this: https://github.com/Spring-Chobby/Chobby ... config.lua , and there is no need to copy any files from the particular library (they're all kept in their own subdir)

The only limitation is that this doesn't currently work with gadgets, and it could use a few more improvements for things that should support luamenu, luaintro and luaui (like chili).

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 12 Sep 2016, 00:06
by Forboding Angel
Hmm, as often as I've been inside chobby, I don't think I've ever bothered to take note of it's file structure. I'll give it a look.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 12 Sep 2016, 12:56
by Forboding Angel
Progress report:
Unitdefs significantly cleaner now
Added a check for modoptions... chicken defense must be enabled specifically in modoptions now to work. This keeps the gadget from doing stupid crap when a nullai or other ai is in the match and not a chicken defense ai. This could be cleaner as in we could look for a chicken defense AI and then set it's status to enabled, but this was a simple low-tech solutions so for now it will do the trick.

Re: Game Agnostic Chicken Defense (Some assembly required)

Posted: 14 Sep 2016, 03:46
by Forboding Angel
Thanks to hoko for pointing me in the right direction, and sprunk for helping me clean up my ultimately messy solution...

As of an hour ago, chickens now will detect if a chicken ai is present and enable/disable itself accordingly. a modoption is no longer necessary.