Author Topic: What are you working on? :D  (Read 34535 times)

0 Members and 1 Guest are viewing this topic.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #300 on: June 29, 2011, 09:42:47 PM »
Doing the new AI, while playing Minecraft :o

So the new AI will be Alien AI V2, it will have a new combating system, so it will be much more efficient and smarter :)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #301 on: June 29, 2011, 10:19:32 PM »
Ah, good ol' Minecraft, where would we be wthout it?

Mars by now, probably. That thing is the biggest time/life sink I've ever come across, barring possibly WoW. That doesn't mean I don't love it though.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #302 on: June 29, 2011, 10:26:05 PM »
Playing WoW? I quit long time ago, reached level 42, if thats the WoW you talk about :P

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #303 on: June 29, 2011, 10:29:58 PM »
I've never actually played WoW (yes, I mean World of Warcraft), but I have seen the effects of it, viz. lack of any productive work. Minecraft on the other hand...

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #304 on: June 29, 2011, 10:31:46 PM »
Ran into a problem, luckily I've commented alot now :)

Code: [Select]
function LevelSetup()

Globals.G.Asteroids=0
Globals.G.EnemyFactionsMin=0
Globals.G.EnemyFactionsMax=0
SetBackdropColour(0,0,0)
Globals.G.GreysProbability = 0
Globals.G.GreysMin=0
Globals.G.GreysMax=0

for i = 0,100 do

a = AddAsteroid(math.random(-10000,10000),math.random(-10000,10000))

if i > 0 and i <= 3 then

a.Owner = i
a:AddSeedlings(40)

else

a.Owner = 0

end

end

AIInit()

end

function LevelLogic()
while GameRunning() do

AIEngine()

coroutine.yield()
end
end

function AIInit()

--Set the globals correct:
Globals.AI.GraceTimer = 9999999

--Create variables needed for the AI
--Changeable AI, be sure to change them if you need!
AIFaction = {2,3}
AINumIterations = 10
AIGraceTime = 5 --Even though this one is here, it doesn't mean all the other normal AI variables work!
--Unchangeable, there is no real value to change...
AIPriority = {}
AINumFactions = 0
AINumRoids = -1
AINeighbour = {}
AINumNeighbours = {}
Engine = AIEngine()

--Run through all possible factions and chack if they are included, this way we can make the matrices for priorities.
for i = 1,10 do

if AIFaction[i] ~= nil then

AINumFactions = AINumFactions + 1
AIPriority[i] = {}

else

break;

end

end

--Run from 0 to a high number(more than what you would want as asteroids on a map) to find any asteroid.
for i = 0,1000 do

if GetAsteroid(i) ~= nil then

--Set all variables for the asteroids...
AINumRoids = AINumRoids + 1
AINumNeighbours[i] = 0
AINeighbour[i] = {}

for j = 1,AINumFactions do

AIPriority[AIFaction[j]][i] = 1000

end

else

break;

end

end
end

function AIEngine()

--If the gracetime is over and the AI hasn't checked yet, then the AI must do so!
if GetGameTime() > AIGraceTime and AIChecked ~= true then

--The AI will run through all of the asteroids twice to find any neighbouring asteroids.
for i = 0,AINumRoids do

for j = 0,AINumRoids do

if i ~= j then

local Xd = GetAsteroid(i).position.x-GetAsteroid(j).position.x
local Yd = GetAsteroid(i).position.y-GetAsteroid(j).position.y
local dist = (Xd^2)+(Yd^2)

if dist < GetAsteroid(i).SendDistance+GetAsteroid(j).Radius then

--As a match occours, it will make the asteroid a neighbour so the AI understands it.
AINumNeighbours[i] = AINumNeighbours[i] + 1
AINeighbour[i][AINumNeighbours[i]] = GetAsteroid(j)

end

end

end

end

AIChecked = true

else

--The gracetime is over and the AI has checked, then we iterate the chosen amount of times and...

for iteration = 1,AINumIterations do

--Choose a random asteroid to check:
local roid = GetAsteroid(math.random(0,AINumRoids))
--But also include the ID for simplicity:
local roidid = roid.ID

--Now run through all of the factions, to allow them to change the priority of the roids

for factionid = 1,AINumFactions do
local faction = AIFaction[factionid]
local ChangedPriority = false

--Check wether the faction owns the asteroid or not.
if roid.Owner == faction then
--Check conditions on the asteroid:
if roid:GetNumSeedlingsExcluding(faction) > roid:GetNumSeedlings(faction)/4 then
--The AI found out that the asteroid is under attack, so we must set the priority to lowest possible, 0!
if AIPriority[faction][roidid] ~= 0 then

AIPriority[faction][roidid] = 0
ChangedPriority = true

end

elseif roid:GetNumSeedlingsExcluding(faction) == 0 then

if AIPriority[faction][roidid] == 0 then
--We're not under attack, but our priority still says so, let's get rid of that!
AIPriority[faction][roidid] = AINumRoids*4
ChangedPriority = true

end

end

if roid:GetNumTrees() < roid.TreeCap then

if AIPriority[faction][roidid] > AINumRoids*1 then
--We need trees and our priority is high enough to not reset any attack priorities!
AIPriority[faction][roidid] = AINumRoids*1
ChangedPriority = true
if roid:GetNumSeedlings(faction) >= 10 then

roid:PlantDysonTree()

end
end

else

if AIPriority[faction][roidid] == AINumRoids*1 then
--We don't need trees, but our priority says so, let's get rid of that!
AIPriority[faction][roidid] = AINumRoids*4
ChangedPriority = true

end

end

else

end

if ChangedPriority == true then
--If we changed any priority, we have to reset all the other, "meaningless" priorities...
for checkedroid = 0,AINumRoids do
if AIPriority[faction][checkedroid] ~= 0 and AIPriority[faction][checkedroid] ~= AINumRoids*1 and AIPriority[faction][checkedroid] ~= AINumRoids*2 and AIPriority[faction][checkedroid] ~= AINumRoids*3 then

AIPriority[faction][checkedroid] = AINumRoids*4

end
end

else
--if we didn't then we must check the neighbours of all asteroids if they are important.
for checked = 0,AINumRoids do
local checkedroid = GetAsteroid(i)
if checkedroid.Owner == faction then
for j = 1,AINumNeighbours[checked] do
if AIPriority[faction][AINeighbour[checked][j].ID] < AIPriority[faction][checked] then
AIPriority[faction][checked] = AIPriority[faction][AINeighbour[checked][j].ID] + 1
if AIPriority[faction][AINeighbour[checked][j].ID] ~= AINumRoids*3 then
if checkedroid:GetNumSeedlings(faction) > 0 then

checkedroid:SendSeedlingsToTarget(faction,checkedroid:GetNumSeedlings(faction),AINeighbour[checked][j])

end
end
end
end
end
end
end
end
end
end
end

The problem is the "local roid = GetAsteroid(math.random(0,AINumRoids))" near the start of the AIEngine() function.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #305 on: June 29, 2011, 10:34:03 PM »
I've never actually played WoW (yes, I mean World of Warcraft), but I have seen the effects of it, viz. lack of any productive work. Minecraft on the other hand...

Lack of productive work? Blizzard lack of that?

Minecraft is neat though, you can join me if you get in on the server I play on :D

It's whitelisted though: http://www.minecraftforum.net/topic/409940-newish-server-looking-for-epic-builders/page__gopid__5718849#entry5718849

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #306 on: June 29, 2011, 10:38:52 PM »
I think that Math.Random is a decimal, you might want to round it.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #307 on: June 29, 2011, 10:46:52 PM »
Nope, that's not the problem, I ran the code before stuff was checked appearantly :S

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: What are you working on? :D
« Reply #308 on: June 30, 2011, 11:13:22 PM »
I'm all out of coding energy for the last few days now..
Maybe gogo at the weekend again..

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #309 on: July 02, 2011, 06:47:38 PM »
Going to make a new map, I seek beta testers already, but not so loudly yet...

I'm going to take a few brakes from the coding, maybe I'll release Adventure soon, I got no idea yet... Atleast I'm making a map :)

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #310 on: July 06, 2011, 05:53:19 PM »
Yay, Reinforcemts: Checked :D

Now to go through some maps with reinforcements and then allow for all tools :P

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #311 on: July 06, 2011, 10:19:17 PM »
Now, you know how I said that I might be able to use EUCLiD for this summer project? Well, I'm fairly sure I'll be able to use it now, all I have to do is get approval from the course supervisor. Expect news soon.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #312 on: July 06, 2011, 10:37:36 PM »
Awesome, but PĂ…ilchard, do you have plans becoming a game programmer?

i do :D

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #313 on: July 07, 2011, 05:25:12 PM »
Adventure might take a while :S

Productivity: 1 map per day

Final goal: around 25(the normal campaign)

Currently done: 5 maps

Maybe I'll update this often, so you can see the progress :)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: What are you working on? :D
« Reply #314 on: July 07, 2011, 06:04:40 PM »
EUCLiD news! I'm starting to work on it as soon as I have a chance. First, though, I've got to get requirements from the end user - that's where you come in. If you could post ideas/requests for features (sensible please, not "WOO MAEK IT FLY AN BAKE A CAK IMMA TROLL") in the EUCLiD thread, that would be a really big help. I know you've all kinda said what you'd like before, but I just really want them consolidated for the evidence that I have to produce. Unfortunately, I probably won't be able to make it Mac compatable just yet, I don't have the time to learn a language that insn't Winfaildows-only before the deadline. Link below, also in maps forum category.

http://www.dyson-game.com/smf/index.php?topic=834.30