AI Custom Resource Question

AI Custom Resource Question

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

AI Custom Resource Question

Post by AF »

Currently I am considering a small subsytem for NTai that would ease the problems with games that implement custom resources.

I am going to change the search for metal extractors to instead use a generic system revolving around a list of points and a few modular objects providing 'resources'.

To do this I need to make sure these assumptions are correct:
  • Custom resources are done using the metal map or features spawned by lua, and I should search for these features.
  • Custom resources are taken by placing a building on them or moving a type of unit within a predefined range.
  • Custom resources have feature names that can be listed and used and aren't auto-generated procedurally.
  • Some resources are generated by building a building anywhere, such as a solar collector generating energy.
  • Resources are either:
    • Consumables with real world positions that must eb acquired
    • Producables such as energy or morale that are generated by buildings or units regardless of location or context
Am I missing something? Are there any casese this would not hold for that are pivotal to an AI being able to play a game here?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: AI Custom Resource Question

Post by KDR_11k »

Positions for points of interest could be queried with a Lua call? THIS's planets have no "physical" presence...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: AI Custom Resource Question

Post by AF »

Aside from planets in THIS, do my assumptions hold? Or do I have to resort to lua call outs if I want to make it work?

For those of you who are not posting you do realise that this could well open up games to AIs that currently do not have fixable AI support without invoking the lua elephant (lua makes AI devs run for the hills)
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: AI Custom Resource Question

Post by Argh »

Positions for points of interest could be queried with a Lua call? THIS's planets have no "physical" presence...
Well, it'd be very simple to change that- it's almost trivial, tbh.

I don't see any serious problems with using Units to key off of for custom resources, given that we can place them arbitrarily in the worldspace, etc., myself. You're just talking about arbitrary assignments of "value" to an AI, right? I.E., "I should capture this, because it's making resources, according to what my config says", etc...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: AI Custom Resource Question

Post by AF »

Basically do my assumptions hold for the majority of content out there? I know it is not valid for 100% of content but if its more than 1 or 2 games then perhaps its worth doing.

But little feedback from people is ever given, no meaningful answers, and then they complain no progress is ever made and wonder why.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: AI Custom Resource Question

Post by Argh »

The only serious quibble I have is with this one:
Custom resources are taken by placing a building on them or moving a type of unit within a predefined range.
AIs can't just move a type of unit, and hope for the best. Some things require CMD.CAPTURE, some require CMD.RECLAIM. Ideally, we'd just have tags in our UnitDefs that told AIs, "hey, you should capture / reclaim these things", to keep it simple to maintain custom resource systems in regards to all AIs. Then every AI developer can address these things generically, without creating yet-more havoc in terms of differing config standards, etc.

Also, why does the prospect of using Lua make AI developers twitch? I haven't really pushed very far into that area, but I'm guessing that making a simplistic AI in Lua would be fairly trivial... most of the map-analysis code anybody would ever want is already written, both by me and other people... so event-driven stuff like NTAI's mainly unit-driven system should be pretty easy to do, I'd think. I'm probably forgetting something major and important, of course, but it just seems like it'd be pretty easy- have it build stuff, and once built, give it an appropriate set of orders, and have strategic code review the orders every few seconds.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: AI Custom Resource Question

Post by KDR_11k »

Well, that would be easy, you define a feature/unit to interact with and the command ID to use on it...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: AI Custom Resource Question

Post by AF »

Argh you fail to realise AI developers do not live in lua land at all, they live somewhere completely different, and the road to lua land is permanently shrouded in mystery as nobody has given an adequate answer to the Ai<->Lua debacle. One day after a lot of angst and problems we were told "There's a road, it starts here and ends somewhere in lua land, I wont tell you how long it is where it goes or how to traverse it just that it exists".

For now its best AI developers do what they can without the need of lua to extend compatibility into areas where it can be done without lua. These assumptions will allow that to an extent.
Post Reply

Return to “Game Development”