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

Dynamic planets

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


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Sat Sep 14, 2013 12:02 pm    Post subject: Dynamic planets Reply with quote

Planets with rules that change on horizon, rules are changed via an interface used by mods (frizz coding needed for the interface)

https://sourceforge.net/u/osbar/dropshock/ci/b129d65894abf277bf6203fe98cd5113557d5ec0/

https://sourceforge.net/p/dropshock/tickets/106/


process_turn.php
Code:
if($planet_dynamic == "Y")
   {
      //Remove active conditions
      $sqltext = "DELETE FROM planet_dynamic WHERE active = 'Y' AND i_planet=? ";
      $res =& $db->query($sqltext, Array($planetid) );
      if (DB::isError($res)) { ReportDBError($res); }
      
      //Get new active conditions, multiple rows are ok, this gets the newest one thus allowing a queue of 'events'
      $planet_settings =& $db->getRow("SELECT * FROM planet_dynamic WHERE i_planet=?", // Contains id, simple_limit, old_school etc...
      array($planetid), DB_FETCHMODE_OBJECT);
      if (DB::isError($planet_settings)) { ReportDBError($planet_settings); }
      
      if($planet_settings) //Is this enough to make sure it exists?
      {
         // Get planet rules
         $planet_simple = $planet_settings->simple_limit; //holds Y or N
         $planet_old_school = $planet_settings->old_school; // holds Y or N
         
         // Mark it as active
         $sql  = "UPDATE planet_dynamic SET active = 'Y' WHERE id=? ";
         $res =& $db->query($sql, Array($planet_settings->id) );
         if (DB::isError($res)) { ReportDBError($res); }
      }
   }


inc_planets.php
Code:
if($planet_dynamic == "Y")
   {
      //Get active conditions
      $planet_settings =& $db->getRow("SELECT simple_limit,old_school FROM planet_dynamic WHERE active = 'Y' AND i_planet=?",
      array($myplanet), DB_FETCHMODE_OBJECT);
      if (DB::isError($planet_settings)) { ReportDBError($planet_settings); }
      
      if($planet_settings) //Is this enough to make sure it exists?
      {
         // Get planet rules
         $planet_simple = $planet_settings->simple_limit; //holds Y or N
         $planet_old_school = $planet_settings->old_school; // holds Y or N
      }
   }


This will allow mods to run events with no need for coding, a simple interface (form to insert and delete records) for a prechosen planet.
Active condition cannot be deleted using the interface, and new conditions even if non existed before it only take effect on horizon (no changing rules mid-cycles)

This will help a lot.

The current ones are simples only and old_school (no code yet) but I thought I'd push this as it WILL help add dynamics for the game.

PLEASE share any ideas for options for such planets

PS: Yes this can be used on all planets
Back to top
View user's profile Send private message
Trerro
Council Member


Joined: 11 Mar 2008
Posts: 1351

PostPosted: Tue Sep 17, 2013 1:22 am    Post subject: Reply with quote

Support. There's all sorts of cool ideas that aren't worthy of a permanent planet, and there's a lot of existing planets that rotating tweaks to would be great (Zed especially).
_________________
[quote="trumpetguy"]And if you double-integrate a BAIII does it become a BAV?[/quote]

Ok... the intergalactic beer run may have been a bad idea. Whoops!
Back to top
View user's profile Send private message Visit poster's website AIM Address
Walterohdim
Site Admin


Joined: 15 Jun 2006
Posts: 1629
Location: Somewhere with lots of doors

PostPosted: Tue Sep 17, 2013 7:55 am    Post subject: Reply with quote

This is something I have wanted for a long time.


Walterohdim
_________________
Wannabee historian of Tinywarz. Through the building of myth we will build community. M. Scott Peck

Back to top
View user's profile Send private message Visit poster's website
Frizz
Site Admin


Joined: 10 Jun 2005
Posts: 3814

PostPosted: Sat Sep 21, 2013 1:50 pm    Post subject: Reply with quote

Unfortunately, the game's not really built for dynamic planets as-is (one of several stumbling blocks is the memory address each planet needs to track time).

It would take MAJOR re-coding to do this one the fly. To give you an idea: the arenas are all actually hard-coded and simply show or hide based on what settings a player enters.

A better approach would be to code-up one planet to be Mod-run OR create a planet that dynamically generates random rules each orbit.

Sorry, but as-is this is too large of a re-write of the code planets were built around.

_f
_________________

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


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Sat Sep 21, 2013 2:06 pm    Post subject: Reply with quote

I always wondered what the memory thing was about

oh well, perhaps 1 planet with a mod interface would be good enough Cool
Back to top
View user's profile Send private message
ParalyzeD
Intermediate


Joined: 16 Mar 2009
Posts: 461

PostPosted: Mon Sep 23, 2013 11:24 am    Post subject: Reply with quote

Quote:
one planet to be Mod-run OR create a planet that dynamically generates random rules each orbit.


aye, if the whole thing is not possible, either of these would be fun
_________________
IGN : eV
Back to top
View user's profile Send private message
ParalyzeD
Intermediate


Joined: 16 Mar 2009
Posts: 461

PostPosted: Mon Sep 23, 2013 11:27 am    Post subject: Reply with quote

Quote:
one planet to be Mod-run OR create a planet that dynamically generates random rules each orbit.


aye, if the whole thing is not possible, either of these would be fun
_________________
IGN : eV
Back to top
View user's profile Send private message
haloguy48
Advanced


Joined: 12 Jul 2006
Posts: 1221
Location: Looking for Group archives

PostPosted: Wed Oct 09, 2013 1:32 am    Post subject: Reply with quote

~Bump~

I'm liking the idea of a randomized rule planet like Frizz said could be done, but a mod ran one too would be cool. I support both of those.
_________________
Check out my Created Construx, all feedback welcomed! I'll start you out on the newer stuff, so just scroll down! Razz
http://forum.mobrulestudios.com/viewtopic.php?p=149822#149822
Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Thu Oct 10, 2013 7:22 am    Post subject: Reply with quote

Frizz wrote:
Unfortunately, the game's not really built for dynamic planets as-is (one of several stumbling blocks is the memory address each planet needs to track time).

It would take MAJOR re-coding to do this one the fly. To give you an idea: the arenas are all actually hard-coded and simply show or hide based on what settings a player enters.

A better approach would be to code-up one planet to be Mod-run OR create a planet that dynamically generates random rules each orbit.

Sorry, but as-is this is too large of a re-write of the code planets were built around.

_f


This may be a bit late but I am just wondering why would it be hard to do this?

Mortum is made PVP or not PVP by a simple date check, I am sure the same can be a done by a simple SQL query.

I wasn't implying that mods would be able to 'create' new planets. They would just modify the variables.

Example atm inf has $planet_simple_only set to 'Y', doing a simple query that pulls 'Y' or 'N' from the database is simple. That 'Y' or 'N' is modified by a form given to mods. So... I am not sure where the problem is.

The somewhat complicated (not really) approach I made in the queries is to make sure rules don't change mid cycle. Make mods able to queue rules instead of waiting for the horizon turn to change it.
Back to top
View user's profile Send private message
Frageran
Sandwich Maker


Joined: 29 Dec 2007
Posts: 3953
Location: Tucson, Arizona

PostPosted: Thu Oct 10, 2013 11:41 am    Post subject: Reply with quote

I support this idea if it's possible!
_________________


Trerro wrote:
Onto my order I need to tack a stack of Shak Attack Pack, so I can smack back my enemies with flak. Quack.
Back to top
View user's profile Send private message
ravneel
Intermediate


Joined: 11 Apr 2008
Posts: 319

PostPosted: Sat Nov 23, 2013 1:08 am    Post subject: Reply with quote

I'd settle for just 1 planet that has its rules changed. After 6 years of knowing what that every planet will do the same thing every cycle, it gets boring.
_________________
Blair [7:29pm]
I see my ass and it looks like your face Razz

Darkc35ar [7:27pm]
look in da mirror and ull get owned =P

Blair [7:25pm]
owned

Darkc35ar [7:23pm]
omfg wrong chat xD

Darkc35ar [7:23pm]
woot 1.4k shak exp so far
Back to top
View user's profile Send private message
razzerblade
Simple


Joined: 26 Feb 2008
Posts: 76
Location: Saginaw, MI

PostPosted: Sat Feb 15, 2014 9:57 am    Post subject: Reply with quote

This is something that could help the game alot right now....also why not do it. We all want more to do and this could help!


Quote:
one planet to be Mod-run OR create a planet that dynamically generates random rules each orbit.
_________________
Don't like my grammar?? too damn bad fool!!
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Drop Shock Forum Index -> Suggestions 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