AI-Client

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
User avatar
MetalKing
Posts: 197
Joined: July 8th, 2011, 11:34 am

AI-Client

Post by MetalKing »

Won't make it the SourceCode cleaner if for AI the Code gets outsourced into into an AI-PlayerClient?
If for that Client gets a FrameWork created other Developers can more easy implement other AIs.

Another Matter concerning the same Issue is load (run) two Maps at same Time in a Single Game.
Is that possible?
"Sir! We are surrounded by our enemies!" - "Excellent ! We can attack in every direction!"
"Make everything as simple as possible, but not simpler." -- Albert Einstein
No Source - No Binary - No Trust!
Map Wesnoth Springs - The great War [200x120],Player=9
Lorbi
Posts: 162
Joined: May 21st, 2007, 6:35 am
Contact:

Re: AI-Client

Post by Lorbi »

MetalKing wrote:Another Matter concerning the same Issue is load (run) two Maps at same Time in a Single Game.
Is that possible?
Why would you need that? You can run two instances of wesnoth?
-- ^ --
User avatar
MetalKing
Posts: 197
Joined: July 8th, 2011, 11:34 am

Re: AI-Client

Post by MetalKing »

If I want to implement a Shop as Sub-Map a Player can enter in MP than I don't want to kick the other Players from the Map due to one Player goes shopping. I can't outsource the SubMap on another Server(Instance) and would I can I won't.
"Sir! We are surrounded by our enemies!" - "Excellent ! We can attack in every direction!"
"Make everything as simple as possible, but not simpler." -- Albert Einstein
No Source - No Binary - No Trust!
Map Wesnoth Springs - The great War [200x120],Player=9
User avatar
Dunno
Posts: 773
Joined: January 17th, 2010, 4:06 pm
Location: Behind you

Re: AI-Client

Post by Dunno »

Well if that helps you can always make a submap by using void terrain. When a units enters shop, you can store that unit and then unstore it in the submap.
Oh, I'm sorry, did I break your concentration?
User avatar
TheScribe
Posts: 465
Joined: June 17th, 2012, 8:17 pm
Location: You won't know till it's too late

Re: AI-Client

Post by TheScribe »

Dunno wrote:Well if that helps you can always make a submap by using void terrain. When a units enters shop, you can store that unit and then unstore it in the submap.
This was done in The Five Fates. It worked rather well.
Sorta on a break from the forums ATM, have been for a while. If I was doing something for/with you and I haven't recently, that's why, I will be back soon hopefully.
User avatar
MetalKing
Posts: 197
Joined: July 8th, 2011, 11:34 am

Re: AI-Client

Post by MetalKing »

TheScribe wrote:
Dunno wrote:Well if that helps you can always make a submap by using void terrain. When a units enters shop, you can store that unit and then unstore it in the submap.
This was done in The Five Fates. It worked rather well.
Does that mean two Map SIMULTAN?
Can I then switch to the other Units?
Can other Players see their Units resp change between Maps where they have Units and view of their Units?
Can I let one Unit in the Shop and return to the other Map and inspect my Units?
"Sir! We are surrounded by our enemies!" - "Excellent ! We can attack in every direction!"
"Make everything as simple as possible, but not simpler." -- Albert Einstein
No Source - No Binary - No Trust!
Map Wesnoth Springs - The great War [200x120],Player=9
User avatar
Dunno
Posts: 773
Joined: January 17th, 2010, 4:06 pm
Location: Behind you

Re: AI-Client

Post by Dunno »

Yes. It's just a bit more harder to code, but not too much.

1. Have you ever used the "void" terrain before? It's that pitch black hex that is impassable. It's used, e.g in conquest on the bottom of the map. It can be used as an impassable border between 2 or more sections of a map. Impassable means that one does not simply pass the void. But you can cross it with a little wml magic
2. Units on both sides of void barrier act exactly as they would if there was no void. That is, they don't get a separate turn, you move units on both sides simultaneously in order you choose. They don't disappear nor they lose their movement or anything.
3. I don't really understand what you mean, but I believe the above point explains it.
4. Yes.

I believe the wml would look something like this: :eng:

Code: Select all

#This event "warps" units from shop hex in the main map to the submap of shop.
#To make them return to the main map from a hex in the submap, you can copy/paste this event with different x,y

[event]
name=moveto
first_time_only=no
   [filter]
#Coordinates of your shop on the main map
   x,y=

#If you want the shop to be accessible only for leader put this part
   canrecruit=yes

   [/filter]
   [store_unit]
#You can change the name of the variable if you like
   variable=shop

      [filter]
#Coordinates of your shop on the main map
      x,y=

      [/filter]
   kill=yes
   [/store_unit]
   [unstore_unit]
   variable=shop
#Coordinates of a hex inside the shop section of the map you want the units to spawn on.
   x,y=

#If you're sure the x,y above are always vacant, you don't have to add the next line, but better be sure.
   find_vacant=yes

   [/unstore_unit]
[/event]
Btw, I think it's better now to ask a mod to move this thread to WML Workshop. I'm a novice in wml, and if this thread is moved you're guaranteed to get some better help :wink:
Cheers.
Oh, I'm sorry, did I break your concentration?
User avatar
MetalKing
Posts: 197
Joined: July 8th, 2011, 11:34 am

Re: AI-Client

Post by MetalKing »

I think there is Kind of MissUnderstanding. If I can (already) with or witout WML put Unit at different Maps than the Engine is already able to run two Maps simulatan. WML can't do that and either the Engine and that Code shows hot wo use it or the Engine can't amd then no WML can do that magic. Where is the Fault?
"Sir! We are surrounded by our enemies!" - "Excellent ! We can attack in every direction!"
"Make everything as simple as possible, but not simpler." -- Albert Einstein
No Source - No Binary - No Trust!
Map Wesnoth Springs - The great War [200x120],Player=9
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: AI-Client

Post by Crendgrim »

The engine does not really support having multiple maps. The only thing you can do is to find certain conditions under which you change it (such as a menuitem), and then store all units of one map to a container, replace the map, and extract all necessary information from another container (this is the way I did it in my add-on). While one map is open, the other one won't be recognized as a/the map, but only the information would be stored in WML until the change is reverted.
What you are planning to do might be possible if you manage to not sync certain action, and sync the result of the shopping. I don't think this would be worth the work and pain, though.

I'm not sure if you understood Dunno's suggestion. He says that you could have a part of the map inaccessible, and teleport the player to this part when shopping.
UMC Story Images — Story images for your campaign!
User avatar
MetalKing
Posts: 197
Joined: July 8th, 2011, 11:34 am

Re: AI-Client

Post by MetalKing »

right! I didn't understand him. thnx for clear explanation.
"Sir! We are surrounded by our enemies!" - "Excellent ! We can attack in every direction!"
"Make everything as simple as possible, but not simpler." -- Albert Einstein
No Source - No Binary - No Trust!
Map Wesnoth Springs - The great War [200x120],Player=9
User avatar
Dunno
Posts: 773
Joined: January 17th, 2010, 4:06 pm
Location: Behind you

Re: AI-Client

Post by Dunno »

right in the belief my english is good :oops:
Oh, I'm sorry, did I break your concentration?
Post Reply