Jump to content


Photo

Survival Discussion

survival

  • Please log in to reply
264 replies to this topic

#101 fuggles

fuggles

    title available

  • Members
  • 4,849 posts

Posted 14 October 2017 - 09:20 AM

Nids use req and necrons use power though?

#102 Kekoulis

Kekoulis

    Apothecary Novice

  • Members
  • 2,151 posts
  • Location:Reclaimed Chemos
  • Projects:Emperor's Children
  •  Slaanesh's Glory

Posted 14 October 2017 - 01:08 PM

I was thinking,why not making this based upon squad cap instead? provided,this would mean that you'd have to raise/lower correspondingly the values for each difficulty but this could potentially solve this.


ec-sig-early2.gif

Mankind has seen the light,the light of Slaanesh.


#103 Gambit

Gambit

    title available

  • Members
  • 6,720 posts
  • Location:Athens, Greece

Posted 14 October 2017 - 01:45 PM

Nids use req and necrons use power though?

Yes. And this is the reason for the problem.

There is a formula (easy to understand) that gets difficulty, based on the total amount of resources a races gets.

It compares a Human player's amassed resources, to an AI player's.

As I said, this is inconsistent, as races like Tyranids or Legion of the Damned has different (or even not at all, in case of LotD) incomes. And this way the comparison fails.

 

One thing that elude me is WHY does the code calculates Players' rates... Aren't they standard?

I was under the impression that only the AI-controlled players get modified resources, based on difficulty...

But this must NOT be the case, since if it was so, the code should ONLY check the amassed amount of AI players, and leave Human players untested.

 

Is anyone with "inner" Intel???

I mean, does anyone know the EXACT resource flow based on difficulty?

If yes, I am sure I can re-write the function and make it much more consistent - because now we have MORE races than before, and I can make the checks based on the specifics of each.

As far as I can tell, THERE IS NO other way to discern difficulty... Only through resources.

 

FOR NOW

For now I left it as is. Made s small modification to somehow fix the +7 of tyranids instead of the +30 (I multiplied it by 30/7). But it is still ... loose.

And if difficulty cannot be determined by the code at all, it is set to Hard, by default.

Even when determined, it is not 100% consistent.

 

 

I was thinking,why not making this based upon squad cap instead? provided,this would mean that you'd have to raise/lower correspondingly the values for each difficulty but this could potentially solve this.

This is not proper for a survival game... :ermm:  Cool idea of course.

And still, will render the player-defined Difficulty setting obsolete.

 

The Assault maps have another way:

There is a probe spawned at player 1's base.

And the more you destroy it (it re-appears) the grater the difficulty.

So say you destroy it 4 times, difficulty is Harder.

Silly method...


-In search of Papasmurf...

#104 Norwegian_Loki

Norwegian_Loki

    title available

  • Members
  • 267 posts
  • Location:Norway
  • Projects:Dawn of War Modding

Posted 14 October 2017 - 02:10 PM

 

Yes. And this is the reason for the problem.

There is a formula (easy to understand) that gets difficulty, based on the total amount of resources a races gets.

It compares a Human player's amassed resources, to an AI player's.

As I said, this is inconsistent, as races like Tyranids or Legion of the Damned has different (or even not at all, in case of LotD) incomes. And this way the comparison fails.

Well the problem seems to an amateur like me that the Tyr and Nec have only one resource. Would it be possible to double it? To make the code believe the Nec have an req, but it actually the pow meter again? And make the code believe Tyr have pow, but it's actually the req again? So it sort of just double the one resource they have?

  :?:  :huh:  :?: ...................................................................................... STOP STARING AT ME!!!!!!!!!!!! :omg:



#105 Gambit

Gambit

    title available

  • Members
  • 6,720 posts
  • Location:Athens, Greece

Posted 14 October 2017 - 02:25 PM

Hehehehe!!!! A workaround.

I did think of that, but it asks for a crucial modification to the races... JUST for a check???!!!!!

Improper :whathuh:

 

Now, if I knew the formula I could have coded it ALL by myself, anew - with 100% consistency.
Hell, I could figure out the formula myself, through sheer experimentation!

 

Again, the question is not IF I can do it.

I CAN ALWAYS DO IT :twisted:

:p

 

The question is "how much time it requires"...


-In search of Papasmurf...

#106 Kasrkin84

Kasrkin84

    title available

  • Members
  • 329 posts
  • Location:Birmingham, UK
  • Projects:Strongholds, Unification

Posted 14 October 2017 - 03:46 PM

Not sure if I've missed something here, but doesn't Cpu_GetDifficulty( playerID ) work for finding out the selected difficulty level? It's what I use.



#107 Gambit

Gambit

    title available

  • Members
  • 6,720 posts
  • Location:Athens, Greece

Posted 14 October 2017 - 06:38 PM

SAY WHAT????
There is a function???

 

Then, I wonder why the community has created a function just for that....

Let me test it, brother K. :thumbsuphappy:


-In search of Papasmurf...

#108 Kasrkin84

Kasrkin84

    title available

  • Members
  • 329 posts
  • Location:Birmingham, UK
  • Projects:Strongholds, Unification

Posted 14 October 2017 - 07:08 PM

I'm thinking it won't work if there's no AI players involved in a game, so maybe that's what the workaround was for.



#109 Gambit

Gambit

    title available

  • Members
  • 6,720 posts
  • Location:Athens, Greece

Posted 14 October 2017 - 07:30 PM

Well, the attacking player is AI.

Even if it is disabled, the function would still return the difficulty, wouldn't it?

And if not... I will disable the AI AFTER getting its difficulty :twisted:


-In search of Papasmurf...

#110 Kasrkin84

Kasrkin84

    title available

  • Members
  • 329 posts
  • Location:Birmingham, UK
  • Projects:Strongholds, Unification

Posted 14 October 2017 - 09:27 PM

Well, the attacking player is AI.

Even if it is disabled, the function would still return the difficulty, wouldn't it?

And if not... I will disable the AI AFTER getting its difficulty :twisted:

 

So long as the function is run BEFORE disabling the AI you should be fine. I haven't actually ever tried using it after, so maybe it will still work - probably best to play it safe though.

 

The function returns an integer from 0 to 4, which can also be named AD_Easy, AD_Standard, AD_Hard, AD_Advanced and AD_Insane respectively.


Edited by Kasrkin84, 14 October 2017 - 09:28 PM.


#111 Gambit

Gambit

    title available

  • Members
  • 6,720 posts
  • Location:Athens, Greece

Posted 14 October 2017 - 11:26 PM

It works, EVEN if the AI is disabled!

The only requirement is to apply it on a cpu player :thumbsuphappy:

 

Brother K to the rescue - once more!


-In search of Papasmurf...

#112 Kasrkin84

Kasrkin84

    title available

  • Members
  • 329 posts
  • Location:Birmingham, UK
  • Projects:Strongholds, Unification

Posted 15 October 2017 - 05:46 AM

You really need to explore Scardoc some more. :p



#113 Gambit

Gambit

    title available

  • Members
  • 6,720 posts
  • Location:Athens, Greece

Posted 15 October 2017 - 09:42 AM

Indeed.

My skills are purely coding-oriented. I can "always" devise the algorithm required to achieve a specific end (and sometimes I come up with the optimal one).

But yeah, my "functions library" is limited, when it comes to SCaR.
On the other hand, I do not trust the SCaRdoc! It is not purely DoW SS-oriented, I tried some functions from there that does not work...

 

Take for example the Cpu_GetDifficulty( playerID ) function.

I suspect it DOES NOT work for DC, only for SS - that is why the survival code had the workaround.

In the end, I think that trial and error, as well as the "trial and error sharing" of fellow coders DOES the trick!


-In search of Papasmurf...

#114 fuggles

fuggles

    title available

  • Members
  • 4,849 posts

Posted 15 October 2017 - 10:38 AM

Was scardoc ever updated for soulstorm? I only recall the one from 1.4, but doubt iron lore had resources. Also not unlikely that Argonaut just did not know the workaround.

#115 Gambit

Gambit

    title available

  • Members
  • 6,720 posts
  • Location:Athens, Greece

Posted 15 October 2017 - 06:32 PM

Well... It seems Agro was correct!

Because I tried some MP games, and the enemy AI was handled by ONLY 1 PC, and the detection was OK on the PC that was handling the AI, but was NOT on the other :thumbsdownsmiley:

No easy fix dammit.

 

Difficulty detection is broken again. :p

 

 

Brother K, is there a way to FORCE the AI to be taken by another player?


Edited by Gambit, 15 October 2017 - 06:34 PM.

-In search of Papasmurf...

#116 fuggles

fuggles

    title available

  • Members
  • 4,849 posts

Posted 15 October 2017 - 07:52 PM

Which pc detects? I assume it can't populate a global table.

So, my answer. As long as one detects, Have it spawn a unique, ideally invisible entity corresponding to the difficulty, other pc scans for one of 4 entities. Finds it, despawn it, done.

#117 Gambit

Gambit

    title available

  • Members
  • 6,720 posts
  • Location:Athens, Greece

Posted 15 October 2017 - 08:33 PM

Have it spawn a unique, ideally invisible entity corresponding to the difficulty, other pc scans for one of 4 entities. Finds it, despawn it, done.

Yeah, my idea as well.

Won't work :thumbsdownsmiley:

The PC that does NOT detect the difficult, will NOT spawn the proper dummy entity -> desyncing...

 

 

Edit: We will either have to

1] "transfer" a variable from PC to PC (impossible).

2] re-initiate the AI from the 2nd PC, after the 1st gets the difficulty

3] Another method, like the one used in Assault :thumbsdownsmiley:


Edited by Gambit, 15 October 2017 - 08:35 PM.

-In search of Papasmurf...

#118 Kasrkin84

Kasrkin84

    title available

  • Members
  • 329 posts
  • Location:Birmingham, UK
  • Projects:Strongholds, Unification

Posted 15 October 2017 - 11:18 PM

Cpu_GetDifficulty is listed in the Scardoc that comes with the official DC modding tools, so it should work for Dark Crusade.

 

There was never an officially updated version for Soulstorm, but there weren't that many new functions anyway.

 

The AI can be forced to a certain level using Cpu_SetDifficultyForDummies( PlayerID, Integer), if that's what you mean. 


Edited by Kasrkin84, 15 October 2017 - 11:23 PM.


#119 Gambit

Gambit

    title available

  • Members
  • 6,720 posts
  • Location:Athens, Greece

Posted 16 October 2017 - 09:12 AM

Brother Kasrkin, the Cpu_GetDifficulty( playerID ) function works great, when only "one PC" is involved.

But with 2 human players (thus, 2 PCs), the enemy AI is controlled ONLY BY ONE PC.

So the function above works OK for the player that his PC controls the enemy AI.

But it does NOT work for the other player, as his PC cannot detect the difficulty !

 

My idea was to first get the difficulty for the 1st player, then somehow RE-INITIATE the AI for the AI-controlled player, and give its control the the 2nd player, so that he can also get the difficulty...

 

Rather impossible, I know...

 

The Cpu_SetDifficultyForDummies( PlayerID, Integer) function, most probably does NOT change the "PC that controls" the AI.

 

 

So let me re-visit brother Fuggles'es idea with the dummy entities. My initial assessment was that it won't work.

But let's hope that if a SCaR destroy command, is given from one PC (but not the other), it WILL be detected as a "killed" command, and will not cause desyncing...


-In search of Papasmurf...

#120 Kasrkin84

Kasrkin84

    title available

  • Members
  • 329 posts
  • Location:Birmingham, UK
  • Projects:Strongholds, Unification

Posted 16 October 2017 - 02:28 PM

I take it then there is no way of setting a global variable from the AI-controlling player only?

 

Hmm... there is Cpu_Enable( playerID, enable ) that works for switching AIs on and off, although I doubt it was designed with this in mind.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users