FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

#41 - Necro/Firestorm AI Fix (ADDED-CLOSED)

 
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source
View previous topic :: View next topic  
Author Message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Thu Dec 13, 2012 6:18 am    Post subject: #41 - Necro/Firestorm AI Fix (ADDED-CLOSED) Reply with quote

Too lazy to update, fixed and waiting for a response

For those who have noticed, there is a bug that tags a firestorm's le AI as a necro's slave

This is both annoying (firestorm les count in the limit of necro AIs) and abusive (forced recall firestorm les, with actimaster it becomes once every other turn)

Files: Process_turn.php

Line 2181 {Forced recall}

before

Code:
$data =& $db->getRow("SELECT id FROM deployed_units WHERE is_destroyed='N' AND crew_id=11  AND i_owner=? ORDER BY RAND() LIMIT 1 ",


after

Code:
$data =& $db->getRow("SELECT id FROM deployed_units as a inner join deployed_effects as b on a.id!=b.i_actor WHERE a.is_destroyed='N' AND a.crew_id=11  AND a.i_owner=? AND b.c_type='LEtrk' ORDER BY RAND() LIMIT 1 ",


line 2211 {creating a new slave}

before

Code:
$data =& $db->getRow("SELECT count(id) ai_count FROM deployed_units WHERE is_destroyed='N' AND crew_id=11 AND i_owner=? ",


after

Code:
$data =& $db->getRow("SELECT count(a.id) ai_count FROM deployed_units as a inner join deployed_effects as b on a.id!=b.i_actor WHERE a.is_destroyed='N' AND a.crew_id=11 AND b.c_type='LEtrk' AND a.i_owner=?  ",


I noticed the acti related to firestorm le checks for c_type='LEtrk' so i hope this works


Note: This is assuming that les have c_type=LE not c_type=LEtrk, otherwise we would end up creating another bug (can't forced recall LEs and they won't count in the AI limit)

ticket link: https://sourceforge.net/p/dropshock/tickets/29/


Last edited by khaibar on Sun Dec 23, 2012 12:46 pm; edited 3 times in total
Back to top
View user's profile Send private message
Dark Leth
Council Member


Joined: 05 Jul 2005
Posts: 1498

PostPosted: Thu Dec 13, 2012 12:42 pm    Post subject: Reply with quote

Bug-fixes should be fast tracked. Support.
Back to top
View user's profile Send private message
Dark Leth
Council Member


Joined: 05 Jul 2005
Posts: 1498

PostPosted: Fri Dec 14, 2012 7:09 am    Post subject: Reply with quote

This code has been approved by the majority of the council.
Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Fri Dec 21, 2012 12:27 am    Post subject: Reply with quote

Alot of things count towards the AI Limit, Turrets for example.

A better fix to this would be to put an identifier on the AI Slaves and have the getRow select from the list those that have it.

Thus, instead of putting identifiers on the turrets and everything else all you have do is seperate the slave from the rest of the pack.
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Fri Dec 21, 2012 2:13 am    Post subject: Reply with quote

i know, but i am trying to fix bugs without adding new variables to the database
Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Fri Dec 21, 2012 8:00 am    Post subject: Reply with quote

Bug-fixes were half the bug is still in effect...? Okay then.
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
maXDooom
Advanced


Joined: 07 Dec 2011
Posts: 757
Location: in perverted places

PostPosted: Fri Dec 21, 2012 9:48 am    Post subject: Reply with quote

why not add new vars to database? we do add stuff everytime we make a multi XD
_________________
Walterohdim wrote:

I would be so mad I would Tomo Rage, and probably lose my mod ship and council seat.

Walterohdim
Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Fri Dec 21, 2012 10:05 am    Post subject: Reply with quote

half-bugs?

Quote:
Note: This is assuming that les have c_type=LE not c_type=LEtrk, otherwise we would end up creating another bug (can't forced recall LEs and they won't count in the AI limit)


that was pretty much a disclaimer, les aren't LEtrk in database unless they are made form firestorms

I am assuming LEtrk is LE track, frizz added that when people abused firestorm acti to make le armies


so no we're not making another bug

As for adding new vars, if frizz makes that possible expect an update frenzy
Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Fri Dec 21, 2012 10:11 am    Post subject: Reply with quote

I meant "where".

Basicly what I'm saying is you left half of the bug still in the code. I wouldn't exactly call this progress.
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Fri Dec 21, 2012 10:24 am    Post subject: Reply with quote

because of the not being able to AI or forced recall LEs?
Like i said u can do that les don't have c_type LEtrk unless they were made by firestorms
Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Fri Dec 21, 2012 10:36 am    Post subject: Reply with quote

Vanoi wrote:
Alot of things count towards the AI Limit, Turrets for example.

khaibar wrote:
i know, but i am trying to fix bugs without adding new variables to the database


Because of that...

What I think we should do is use the Unit ID of the unit that summoned them as the identifier therefore each unit would have command of their own AIs. The Firestorm LE spam was really just a phase if anything I think we should just duration them.
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Sun Dec 23, 2012 11:29 am    Post subject: Reply with quote

frizz said it won't work
I figured out why but now i can't think of a way to make it happen without modifying structures X_X


never mind found a way, we have to inner join with effects to see if units are actor in LEtrk.

But that aint health X_X
Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Sun Dec 23, 2012 11:57 am    Post subject: Reply with quote

updated, should work now

or not... lol i will need to think a bit
Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Fri Dec 28, 2012 4:09 pm    Post subject: Reply with quote

I support the new version of this fix.
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group