Author Topic: more Ressources harvesting problem(Worker harvest only Gold and Stone)  (Read 2948 times)

RealtimeFreak

  • Guest
i would like, that the Worker more Ressources harvested.
Ok,I have set follow settings in the XML file worker.xml

what i say can: the worker harvestet only Gold and Stone /:
to other Ressources: the worker geht to the other ressources, Animation beginns, and Worker stands still
than get the worker not back to the Base, shorty say: thats a endless Animation from the Worker, but returns the Base not and stand still.

i have the Ressources placement set in the Map Editor.

here my Worker.xml file:

Code: [Select]

                                 <!-- GOLD resource-number value="1" -->
                      <command>
<type value="harvest"/>
<name value="mine"/>
<image path="images/worker_mine.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="move_gold_skill"/>
<harvest-skill value="mine_skill"/>
<stop-loaded-skill value="stop_loaded_skill"/>
<move-loaded-skill value="move_loaded_skill"/>
<harvested-resources>
<resource name="gold"/>
</harvested-resources>
<max-load value="30"/>
<hits-per-unit value="1"/>
                       </command>

                               <!-- METAL --  resource-number value="2" -->
                      <command>
<type value="harvest"/>
<name value="mine"/>
<image path="images/worker_mine.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="move_gold_skill"/>
<harvest-skill value="mine_skill"/>
<stop-loaded-skill value="stop_loaded_skill"/>
<move-loaded-skill value="move_loaded_skill"/>
<harvested-resources>
                        <resource name="metal"/>
</harvested-resources>
<max-load value="30"/>
<hits-per-unit value="1"/>
                       </command>

                            <!-- TIN --  resource-number value="3" -->
                      <command>
<type value="harvest"/>
<name value="mine"/>
<image path="images/worker_mine.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="move_gold_skill"/>
<harvest-skill value="mine_skill"/>
<stop-loaded-skill value="stop_loaded_skill"/>
<move-loaded-skill value="move_loaded_skill"/>
<harvested-resources>
                        <resource name="tin"/>
</harvested-resources>
<max-load value="15"/>
<hits-per-unit value="1"/>
                       </command>

                            <!-- OIL  resource-number value="4"-->
                      <command>
<type value="harvest"/>
<name value="mine"/>
<image path="images/worker_mine.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="move_gold_skill"/>
<harvest-skill value="mine_skill"/>
<stop-loaded-skill value="stop_loaded_skill"/>
<move-loaded-skill value="move_loaded_skill"/>
<harvested-resources>
<resource name="oil"/>
</harvested-resources>
<max-load value="10"/>
<hits-per-unit value="1"/>
                       </command>

                       <!-- STONE  resource-number value="5" -->
                      <command>
<type value="harvest"/>
<name value="mine"/>
<image path="images/worker_mine.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="move_gold_skill"/>
<harvest-skill value="mine_skill"/>
<stop-loaded-skill value="stop_loaded_skill"/>
<move-loaded-skill value="move_loaded_skill"/>
<harvested-resources>
<resource name="stone"/>
</harvested-resources>
<max-load value="40"/>
<hits-per-unit value="1"/>
                       </command>

// I HAVE CHANGED THE RESSOURCES PLACEMENT IN THE MAP EDITOR


what can i do?

It thats a generally Ressource Limit?

srry for my Bad English..

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Can you please provide a screenshot? (press "E" to take one)
This is in GAE, right? I mean I know you posted it in the GAE board, but sometimes...  :|
Good Luck.  :)  :thumbup:

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Do you have somewhere that the workers can store these new resources ??

Code: [Select]
<!-- my_new_store.xml -->
<unit>
   <parameters>
      ...
         <resources-stored>
            <resource name= "my_new_resource" amount="1500"/>
            ...
Glest Advanced Engine - Code Monkey

Timeline | Downloads

RealtimeFreak

  • Guest
ok i see what you meen

now, the problem is ever still available /:

is that right so?

the code:

Code: [Select]
<?xml version="1.0" standalone="no"?>

<unit>

<!-- *** parameters *** -->

<parameters>
<size value="1"/>
<height value="2"/>
<max-hp value="600" regeneration="0"/>
<max-ep value="0"/>
<armor value="0"/>
<armor-type value="leather"/>
<sight value="9"/>
<time value="40"/>
<multi-selection value="true"/>
<cellmap value="false"/>
<levels/>
<fields>
<field value="land"/>
</fields>
<properties/>
<light enabled="false"/>
<unit-requirements/>
<upgrade-requirements/>
<resource-requirements>
<resource name="gold" amount="75"/>
<resource name="food" amount="1"/>
</resource-requirements>
<resources-stored/>
                <resource name= "metal" amount="1500"/>
                <resource name= "tin" amount="1500"/>
                <resource name= "oil" amount="1500"/>
<image path="images/worker.bmp"/>
<image-cancel path="../archer/images/tech_cancel.bmp"/>
<meeting-point value="false"/>
<selection-sounds enabled="true">
<sound path="sounds/worker_select1.wav"/>
<sound path="sounds/worker_select2.wav"/>
<sound path="sounds/worker_select3.wav"/>
<sound path="sounds/worker_select4.wav"/>
</selection-sounds>
<command-sounds enabled="true">
<sound path="sounds/worker_ack1.wav"/>
<sound path="sounds/worker_ack2.wav"/>
<sound path="sounds/worker_ack3.wav"/>
<sound path="sounds/worker_ack4.wav"/>
<sound path="sounds/worker_ack5.wav"/>
<sound path="sounds/worker_ack6.wav"/>
<sound path="sounds/worker_ack7.wav"/>
</command-sounds>
</parameters>

EDIT: okay it works ^^, great thx

i have a Generaly Question:

how many Ressources supportet GAE, can you give me a Number?
i see the Map Editor supportet Max 6 Ressource Places.
can i that changed more at 6 in the Map Editor ?
« Last Edit: 24 March 2010, 02:34:00 by RealtimeFreak »

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
The problem is they have nowhere to take the resources when they are fully loaded. You need a 'store' unit that can store them.

Look at the castle's XML, it can store gold(2000), wood(1200), stone(1500) and food(150).

You need a unit that can store your new resources, then when workers are loaded up, they will go to said store to drop them off, and return to harvest more. The reason they stop is because they have nowhere to unload the new resources.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

RealtimeFreak

  • Guest
okay it works ^^, great thx

i have a Generaly Question:

how many Ressources supportet GAE, can you give me a Number?
i see the Map Editor supportet Max 6 Ressource Places.
can i that changed more at 6 in the Map Editor ?

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
It's 5, and it can't be changed without breaking all existing maps, so it wont be lifted any time soon.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

RealtimeFreak

  • Guest
uhh that is yes a little stupid /:

i think, for more ressources placement
i must wait for a Version where supportet more Ressources  :(

ok, thanks just the same.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Its 5 ressources in the map editor, but look at the wood ressource, its made a different way, so maybe you can add more this way?
And this are only the harvestable ressources, of course you can have other ressources too, like energy in the magic faction or housing for the indians.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

RealtimeFreak

  • Guest
Okay thx

RealtimeFreak

  • Guest
me again what noticed:

i placed all free Custom Ressources 3,4,5 on the Map with the Glest Map Editor.
I placed Ressource 3,4,5 in the Ressource Folder and set the Ressources in files down
but.. the AI,harvesting only 2 Ressources ,if the Ressources from Editor
in the Map implementet,than failure the AI system.The AI make follow:
1. AI stands still a while
2. AI attacks my Base with all Units from AI
3. AI build buildings, but not Units
4. the AI harvesting not.
other to similar..

what can that be?

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Does the faction have units that require the new resources to build? If it doesn't need the resources the AI is unlikely to harvest them ;)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

RealtimeFreak

  • Guest
yes my workers supportet the ressources in the XML files.
the AI Player played the same faction the i play.
but not to make : /

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
You need more than just a worker who can harvest them, you also need other units that require those new resources to be built.  If the AI does not need a resource, it will not assign any workers to harvesting it.

You need to give the AI a reason to harvest it, then you should find that it does :)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

RealtimeFreak

  • Guest
no,no the AI Player harvested generally not when i the new Ressources add in the files.

modman

  • Guest
I'm not sure what you're trying to say, but may I suggest that you also will need to have those resources on the map?

Also, what units in your faction require these new resources?  If the buildings don't require the new ones, this is why the AI builds them.

RealtimeFreak

  • Guest
again to situation.
the problem comes from the Ressource folder in Glest.
so me all understand:

to ahead: required Ressources have i set to many units,that has not brought.

so to problem , the Ressource folder have default moderate: energy,food,gold,stone,wood (thats all 5 Ressources)
node:
energy = its static(thats 1 Ressource)
food= its Consumable(thats 1 Ressource)
gold,wood,stone, its harvesting from the map (thats 3 Ressources)
now,if i add a new harvesting Ressources in that Ressource folder, then ocours that problem with the AI of.

i mean a limit of the harvesting Ressources blocks the AI system,if more at 3 harvesting Ressources in the file folder placed.

if i the new [harvesting Ressources] from the folder Remove, then its that AI system again normaly.

i hope now, understand me all?
« Last Edit: 7 April 2010, 16:03:47 by RealtimeFreak »

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Ok, I've done some poking around... there is no limit of 5 'tech' resources, it is indeed a limit in the map editor.
There is a limit of 10 tileset objects, in the map object/resource 'slot' per tile they are 1-10 (with 0 being no object/resource), anything > 10 is a tech resource, the map format use an int8 per tile for object/resource so the game can actually support up to 117 tech resources.

The logic in the AI seems to be fine, they should be harvesting resources they need. Will investigate properly in due course, but am a bit busy with other things atm.

Cheers.

Glest Advanced Engine - Code Monkey

Timeline | Downloads

RealtimeFreak

  • Guest
Okay, now i have follow changed:

Code: [Select]
//read objects
for (int j = 0; j < h; ++j) {
for (int i = 0; i < w; ++i) {
int obj;
fread(&obj, sizeof(int), 1, f1);
if (obj <= 100) {
cells[i][j].object = obj;
} else {
cells[i][j].resource = obj - 100;
}
}
}

Code: [Select]
//write objects
for (int j = 0; j < h; ++j) {
for (int i = 0; i < w; ++i) {
if (cells[i][j].resource == 0)
fwrite(&cells[i][j].object, sizeof(int), 1, f1);
else {
int res = cells[i][j].resource + 100;
fwrite(&res, sizeof(int), 1, f1);
}
}
}

state remains unchanged /:

RealtimeFreak

  • Guest
WHY HELP ME NOBODY? :look: