[Suggestion] energy system ideas
energy system ideas Posted on: 01/26/2015 2:16am
Quote Post
Never let a computer tell me shit.

we should do an energy system instead of the 5 second timer.
for example, you could build hydro-power plants next to bodies of water (making being near a body of water useful) that generate more power

Option 1, remove the time limit, have actions cost power.  you regenerate power every X minutes equal to your power 
Option 2, allow power consumption only to remove the 5s timer,and regenerate power more slowly,that way, even when you're out of power, you can still play
 kolonel for option 1, creamy for option 2

how often should energy re-accumulate? 1 per 10 minutes
or do we do "predictive energy" such as calculating time since last DB update should yield X amount of energy then let the cron set real values when appropriate
predictive, so everyone gets their own "tick"
and every action pass an updated "time" to the player so they can have a countdown until the next energy++
(current - lastaward)/refillTime => number of power to award
(current -lastaward)%refilltime => time remaining until next award
all times as seconds

I wonder how we'd handle this at early levels and/or what the actual consumption rate would be

300
 ewac is free or 1
 attack free space is 1 or 2
 attack player/special tile is 3 or  maybe scale the cost based on level difference of players

evac being free sounds good to me I guess the only reason for making it cost anything is checkering nations since you could attack someone on a diagonal, then quickly evac
 maybe base cost on borders  like if its emty border or your own country , then no cost. if it borders on an enemy, then 50% cost of attacking
 fair enough



maybe some other things too. 
​[17:25:13] <The Ignorant Masses> hmmm...
[17:25:26] <The Ignorant Masses> I could put the internal geo-efficiency check on, say, a 15s timeout




I use this AoB tool to make all the AoBs I post. Try the online version if you dont feel like downloading it.
"Obviously, windows are central to Windows. They are so important that they named the operating system after them. But what is a window?"

RE: energy system ideas Posted on: 01/26/2015 2:19am
Quote Post

(11:51:17 PM) Dust of Angels: id say out of power, out of play time

(11:51:30 PM) creamy: option 2 def

(2:52:49 AM) thenewcomer: please no energy bullshit waiting system
(2:53:09 AM) thenewcomer: i would rather have a 10s timer between every fucking click
(2:54:19 AM) thenewcomer: anything is better than the "you did 5 things, now wait 3 hours to do it again" bullshit system
 




I have gone to find myself. If I return before I get back, please hold me here until I arrive.
RE: energy system ideas Posted on: 01/26/2015 3:33pm
Quote Post
TIM the Enchanter
Level: 1
ADR Info


Right now, the general bitch is the 5s wait time.  People want to be able to click as fast as they fucking please.  There-in lies the problem.  Geo calcs consume vast amounts of resources and take up a fuckload of time.  We're talking about thrashing the fuck out of a 2.6 million record database ON EVERY CLICK.

Fortifying doesn't effect geo-eff, so it's not recaltulated here.
For evacing, average time is 1.1s
For capturing empty land, average time is 1.4s
For attacking another nation, average time is 2s
Running a few tests, a 5K nation attacking another 5K nation (5K as in the number of tiles), we're talking close to 3.6s

Our talks about an "energy system" would involve removing this timeout.  While it would undoubtedly cause an untold numbers of problems, it would be one way to make the energy attribute useful for something other than combat calculations.  It would also shut those mother fuckers up that continue to bitch and complain about the 5s wait despite numerous explinations of why it's there.  It would also become one of those "spend your money here to refresh your energy" money pits of sorts.  I don't really want to go that way, but hey, if sheeple love paying for shit, why not?

The inherent problem with this game is the map.  The map is intensive.  It's massive.  Even with indexes on every column, it's still slow as fuck.  We don't have a DB server, we have an all-purpose web-server, serving up all-purpose content.  We could convert to nginx to get a slight speed improvement, but at the cost of extensions used for functionality.  I could hack our server apart and install a different database handler such as Percona MySQL or Maria DB, but we lose all support from our webhost.  I could throw more stuff into memcache, but we'd still be waiting on non-async mysql updates...

One solution I threw together was only re-hashing geo-efficiency every 15-30s.  This way, we'd be ok for a few clicks, then slam the db, then ok for a few clicks, slam the database, rinse and repeat.
This would involve a timestamp on the nation record, when that timestamp expires, the next time the geo-calc functions is called, run it, restamp.

Some people have suggested crons.  Terrible idea.  Why cause a bunch of load when not necessary?  What if no one's played this hour?  Should we rehash the fuck out of everything every 60 seconds?  Even at that rate, what would that do to other stuff running on the server, you know, such as KongHack?

I've also been thinking about table partitioning.  Even with this, I'm facing issues.  For typical data, you could partition on, say, every 100K records, or check a data field and partition on the year.  For us, we're looking at an X and a Y column.  We could create 1600 partitions for X, but since we're loading from both, it'd probably be slower.  Partitioning, along with the image rendering idea, lead me to a different solution that might work, although it would be overly complex.

/Free flow thought, just bear with me...
Separate map tables per 25x25 quadrant.  It's insane, sure.  We'd wind up with 10,240 tables.  We could split tables by X and we'd only have 1600 tables.
Ok, make it a larger quadrant, 50x50.  That's 4 map screens total.  Hmm, now we're at 512 tables. Sounds much more doable.
How about 100x100.  That's 4 screens across and 4 screens down, or 16 screens in total. That's 256 tables.

The war system needs its own database.  That way we can keep it's core data separate from the KongHack data.  Especially for backups.
10K records is easier to cycle through than 2.56M records.  The indexes will play nicer, as unused tables indexes will just pop in and out of memory as needed, while active tables will hang around in memory longer.  This should reduce DB lag.

But this will make queries extremely complex.  Kinda.  We're looking at more programming overhead, but an overall performance gain.  How would we calculate geo-eff across quadrants?  How would we even display map points across quadrants?  
1) We'd need to build unions when looking at the map on a crossroads between quadrants.
2) We'd need to only display fixed quadrant portions instead of focusing on the "current" tile.  Add some LRUD buttons around the map so people could pan the map instead of moving and centering on a tile.

How would we calc out geo eff?
-Each nation would have a "I'm in this quadrant, and here's coords for this quadrant" record.
-We'd then pool those coords and run our current geo-eff test.  Say you were in 3 quadrants, we'd pull 3 records from the DB and test against an array of coords.
-The inherent problem is storing those coords.  We'd have to get all coords you owned in that quadrant any time a change was made to your data in that quadrant, and stash them in a row.

/end

Anyway, anyone out there have any thoughts?





Everything's coming up KongHack!

"When you know nothing matters, the universe is yours" ~Rick Sanchez

RE: energy system ideas Posted on: 01/26/2015 6:01pm
Quote Post

Maybe combine this with my shared 5s idea?
Which was - server ticks every 5s (or more) and everyone can do one action (by default) during this time. No more counting individual times, just everyone has an "action" record in the DB and they all execute at once. You can sell additional actions per tick (with a sane limit, please).
To reduce server load have a common flag which is turned by any action from any player, no players - no calculations to do. Next tick clears this flag after all calcs are done, so a tick can get prolonged under heavy usage, thus introducing some "server lag"
Now, combine this with your quadrants idea - each quadrant has one such shared flag too, any action in this quadrant flips its flag to tell the server there is some calc to do there.

This way if at any time there is movement in just one quadrant, the common server flag and only the flag for this quadrant are flipped, and the calcs are done only for this area at the end of the tick.

btw. you can also sell custom nation tile pics or some other pure cosmetic stuff - people seem to love anything they can brag about :P

Thoughts?

About calculating geo eff across quadrants - can you calc each quadrant separately, then somehow combine those and still get the same result as with the current system?
Maybe quadrants would need to overlap by 1 tile on each side, so a lone tile in a quadrant would still be counted as connected to the neighbour tiles on the next quadrant?




I have gone to find myself. If I return before I get back, please hold me here until I arrive.
RE: energy system ideas Posted on: 01/26/2015 6:48pm
Quote Post
TIM the Enchanter
Level: 1
ADR Info

Fuck that.  Setting a "server tick"?  That's more overhead than the current system.  It also leads to the, I clicked right at the end of the tick and at the beginning of the next, oh fuck lag.

tl;dr, doesn't solve anything, just creates more db thrashing.  Current "ticks" never hit the DB.

Quads couldn't overlap, as that would be duplicate records, which you can't have in a properly structured database.  All of your questions are answered in the "How would we calc out geo eff?" block. :P





Everything's coming up KongHack!

"When you know nothing matters, the universe is yours" ~Rick Sanchez

RE: energy system ideas Posted on: 01/26/2015 7:33pm
Quote Post
The Unity Apprentice

Just a random opinion passing through: I'm completely fine with option 2 but tbh i like it the way it is and wouldn't really want a energy system :)

RE: energy system ideas Posted on: 01/26/2015 8:26pm
Quote Post
TIM the Enchanter
Level: 1
ADR Info
Lucifer Posted on: 01/26/2015 2:33pm

Just a random opinion passing through: I'm completely fine with option 2 but tbh i like it the way it is and wouldn't really want a energy system :)


Agreed.  The way it is now is true to the game and doesn't impose any insane complexity, no additional systems, etc.


I want everyone to be clear on one thing.  This game is NOT to make ME money.  This game is to fund the site.  I've poured years of my life into programming this site, and our deidcated hackers and staff and pumped just as much time and energy into it as well, if not more so.  Personally, I've dropped a cool grand into the site so far, not including a handful of other expenses for marketing campaigns and consultations.  Every cent made from KHWar (or whatever we call it) will be going into the site's bank account.  I'm meeting with an attorney tomorrow to set up KongHack Inc. as a licensed S. Corp.  That also means the GCWorld Industries link in the footer will be changing. :wink:

I love this site and all of YOU for helping make it happen.  I truly feel that if we can pull this off, together as a community, we'll be able to go further and be better than anyone else out there.

~TiM





Everything's coming up KongHack!

"When you know nothing matters, the universe is yours" ~Rick Sanchez

RE: energy system ideas Posted on: 01/27/2015 4:27am
Quote Post

It would seem the current system is the only viable one without a ton of optimizations (may not be possible unless P = NP) or a supercomputer.

With that in mind, we should try to add somethinng to the current system instead of changing it. Race War Kingdoms has a similar delay between actions. They made it tolerable by implementing a chat as a core mechanic in the game and adding a poker minigame that allows players to slowly but surely win ingame currency. The chat is already there, and there will be one when it goes live on Kongregate as well. I suggest adding a multiplayer minigame (with a betting system?) and/or a singleplayer minigame that allows players to slowly earn points (bad ideas: tetris, bejeweled, etc., as they require constant attention. Better idea: war-style physics game, Angry Birds with regular catapults and kingdoms). This, of course, requires quite a lot of time.

RE: energy system ideas Posted on: 01/27/2015 5:40am
Quote Post
Never let a computer tell me shit.

I was thinking 2 things in my sleep.
hide the 5s delay behind battle animations, kinda like how call of gods does it. I was thinking in this game if you attack a free land, you are shown fighting an indigenous creature(sand worm in the desert, giant bird in the forest, etc), or if you attack a player, you are shown fighting the players defensive weapon. for evac you could be shown burning down the city or whatever. 


secondarily, you may already be doing this, but instead of calculating the entire nation's geoEff every action, maybe you could calculate a delta for each action instead.

eg: you know the nations faces and tile count. then when you perform a successful attack, all you need to do is pull 5 tiles from the db; the attacked tile and its faces. Then just add that delta to the main geoEff calculation.




I use this AoB tool to make all the AoBs I post. Try the online version if you dont feel like downloading it.
"Obviously, windows are central to Windows. They are so important that they named the operating system after them. But what is a window?"

RE: energy system ideas Posted on: 01/27/2015 1:09pm
Quote Post
TIM the Enchanter
Level: 1
ADR Info

I was thinking about that as well, but have no idea mathematically and relationally how to pull that off.  Just not in that mindset yet. :(

Animations would be great, but I'm not an animator, and I won't be stealing animations from the net just to get hammered with a lawsuit later.  This is America, land of the fucking lawyers.





Everything's coming up KongHack!

"When you know nothing matters, the universe is yours" ~Rick Sanchez

RE: energy system ideas Posted on: 01/30/2015 6:16pm
Quote Post

I notice some delayed recalculation/updating today (or my client got screwed up). How often are geo eff, faces, etc. refreshed now?
Also, could you add an exception, so these are immediately refreshed when capturing or losing a landmark?




I have gone to find myself. If I return before I get back, please hold me here until I arrive.
RE: energy system ideas Posted on: 01/30/2015 11:08pm
Quote Post
disgruntled old man

You probably already have your answer, but I believe it's once every 60 seconds




New to Kong Hack and want to learn the basics? Check out the [Kong Hack 101] and the [Hacking 101].
Wanna learn how we make the hacks? Start with getting [the tools], then check these out: [AoB tutorial] | [.sol guide] | [Unity3d tutorial] | kadat's [video tutorials]
And if you don't already have it, check out the [Kong Hack Ultra Trainer]. You'll be glad you did!
RE: energy system ideas Posted on: 01/31/2015 3:31am
Quote Post
TIM the Enchanter
Level: 1
ADR Info

Posted numerous times in both chats.  Geo is calcualted once every 60 seconds to reduce lag.





Everything's coming up KongHack!

"When you know nothing matters, the universe is yours" ~Rick Sanchez

RE: energy system ideas Posted on: 01/31/2015 9:45am
Quote Post

Posted before seeing it in chat, thanks.

How about removing the delay for evacuating? This would make recovering from being checkered an actual option instead of the "Pff, it will take ages to evac those bazilion tiles, i'll just abandon" approach.
Have the client set up an evac queue when there are consecutive evacs. Then send the whole queue as a single command when either: the queue is full; the last action is not evac; or there were no actions for 5 seconds.
You can even have the tiles in the queue highlighted on the map and a second click on one remove it from the queue.
 




I have gone to find myself. If I return before I get back, please hold me here until I arrive.
RE: energy system ideas Posted on: 01/31/2015 1:38pm
Quote Post
TIM the Enchanter
Level: 1
ADR Info

There is 1 "Calc Geo" function.  The timeout is part of that.  Tough Shit.





Everything's coming up KongHack!

"When you know nothing matters, the universe is yours" ~Rick Sanchez