Jump to content
MakeWebGames

Okay I Give Up (For the moment)


gmoore
 Share

Recommended Posts

Starting my new job has made me realize my time has just gone to zero. I am going to put up a stock version of NWE to at least feel like I am running something. But IMPLORE you (and I mean to keep me sane) to put an ownership for a location (based on Clan) and something that gives the location uniqueness. So I can see something different from location to location like a statistic or value or something..

Please help me lol.

Greg .. the corporate owned. Is that like a zombie?

Link to comment
Share on other sites

(As I am getting ready to go to the pit of lions and boredom ... lol, love working at home, the money was just too good)

Of course. I wasn't asking for custom programming. I spent 2 hours sifting through things ti determine HOW I could get things up quick while my daughter had ballet class. I have been trying to make NWE perfect for me, but as we all know as programmers, there is no PERFECT system. If there was we'd all retire lol.

The only thing in the system I saw that was crutial to success was:

Locations need more details. This should include an image(just a field location_image with upload capability) and some sort of stats (could be location_stats table, location_id, stat_type, stat_amount). This way we can add Walls 20, Moat 30, Spikes 15 to make it more interesting, something other than Somewhere, where you can move to SomewhereElse. Just cooler.

That's it, I think I can get things up quick with that.

My time going to zero really sucks. And thank you for the database table mod.

Greg

Link to comment
Share on other sites

Once again have I miss understood your post, I missed what you meant by locations.. You want a grid map for exploration locations?

Think this old project of mine is what you are wanting to make. The map is tile based and you get to options for what to do. Each tile is own able, and one tile can occupy multiple spaces in the grid.

 

 

[ATTACH=CONFIG]851[/ATTACH]

 

[ATTACH=CONFIG]852[/ATTACH]

tilegridmap2.png.85ec773c1ce5f22254c31008689a0e24.png

tilegridmap.png.195ea961fc4c21d19bd19c1a7be0d1ee.png

Link to comment
Share on other sites

Hey Someone, you are posting while I read.

Sure but not a map so much (too much work). But your first image was dead on for detail. It's not a crime game, but if it was, I would take an image of the Brooklyn Bridge as a page header and say there are 2,000 people, 10 police and 32 street venders. Which I could use to determine what I could do there in the crime module.

Just trying to see what would be missing in the base NWE before I could get started. Without all my psycho changes I have done and felt I need to do.

Greg

Link to comment
Share on other sites

Forgot how much effort I had into that project. Glad it could still run.

Even made a simple tile map designer for it. Getting interested in bringing it into life in some form again.

Yeah the page itself there is based on the whole game being managed through jQuery. Data is loaded into divs from the back end, so you do not refresh the whole page. The mao itself is one image, it uses <area> to define click able tiles, that pops up the small menu, and moes the arrow marker to that location. And load the possible actions to the window to the left, and updates the small buttons under the image.

 

Posting how its built in case anyone is interested in doing something similar.

The Make data table generates sql info

INSERT INTO `map_blocks2` 
		(`id`, `mapid`, `blockid`, `type`, `actions`, `back_possible`, `back_owner`, `back_manager`,  `back_profit`, `back_stock`, `back_protector`, `back_type`, `back_variables`, `back_name`, `back_message`, `block_name`, `block_description`, `front_owner`, `front_protector`, `front_manager`, `front_profit`, `front_variables`, `front_message`) VALUES (NULL, '0', '0', '1', '1-3-6', '0', '0', '0', '0', '0', '0', '0', '', '', '', '', '', '0', '0', '0', '0', '', '');
INSERT INTO `map_blocks2` 
		(`id`, `mapid`, `blockid`, `type`, `actions`, `back_possible`, `back_owner`, `back_manager`,  `back_profit`, `back_stock`, `back_protector`, `back_type`, `back_variables`, `back_name`, `back_message`, `block_name`, `block_description`, `front_owner`, `front_protector`, `front_manager`, `front_profit`, `front_variables`, `front_message`) VALUES (NULL, '0', '1', '1', '1-3-6', '0', '0', '0', '0', '0', '0', '0', '', '', '', '', '', '0', '0', '0', '0', '', '');
etc
etc

 

Build link generates the areas that should be clickable on the image.

<area blocknum="0" posActions="1-3-6" areaType="1" blockinfo="Police Station" shape="rect" coords="0,0,32,32" href="#0" />
<area blocknum="1" posActions="1-3-6" areaType="1" blockinfo="Police Station" shape="rect" coords="32,0,64,32" href="#1" />
<area blocknum="3" posActions="1-2-3-4-6-7" areaType="2" blockinfo="Bank" shape="rect" coords="96,0,128,32" href="#3" />
etc
etc

 

[ATTACH=CONFIG]853[/ATTACH]

tilegridmap3.thumb.png.664247f557d1e0f9801d6d30c7bd5c11.png

Edited by Someone
added some details
Link to comment
Share on other sites

It wasn't so much the mapping as an image associated with the location. Thought mapping is WAY cooler (NEAB has it, you would think it could be cut and paste ... lol, I know not so easy).

But stats about the location is very important. This could affect everything from actions to training to whatever.

Just trying to get something up with as little time programming and more time spent on content. As my time has dwindled from 8-10 hours a day to maybe 1.

Greg

Link to comment
Share on other sites

I would take an image of the Brooklyn Bridge as a page header and say there are 2,000 people, 10 police and 32 street venders. Which I could use to determine what I could do there in the crime module.

LOL that points back to what I thought you first meant :confused:

And is something Ive been working on, and willing to share. (If Alain or someone else makes it thats even better, the more diversity the better)

My version would take extra effort to get working with other parts of the game, that I might not be interested in modifying to work with my project.

 

Locations need more details. This should include an image(just a field location_image with upload capability) and some sort of stats (could be location_stats table, location_id, stat_type, stat_amount). This way we can add Walls 20, Moat 30, Spikes 15 to make it more interesting, something other than Somewhere, where you can move to SomewhereElse. Just cooler.

This is why I thought you wanted a tile map

Link to comment
Share on other sites

(Gotta get out the door or I will be late but CAN'T stay away from the forum)

I ***DO*** want a tile map but don't expect it. Anything that gets some graphics into the game is A++, however I was trying to keep it simple.

I think some location stats would give some personality to the locations. Such as in a crime style game, the number of tenements might increase the ease of crime but the number of luxury apartments might increase the value of the crime. I don't know just thinking outloud.

I am trying to see what I have worked on over the last couple weeks if it is even worth giving to the community. I have been mostly working on my minimalist version which doesn't help the engine. Mostly I just found bugs and such when modules are expecting other modules (which I have posted either fixes or Alain fixed them). Was just starting on the custom modules sections. My new job is filtering websites like 99% so no longer can poke around during the day.

Mentally I need to get a game up even if it is not all that I wanted just to keep my mind in it. Otherwise it is too easy to get caught up in life and another year passes.

(Okay wife yelling for me to get out the door. It's snowing and I have a little car lol)

Greg

Link to comment
Share on other sites

I will check how to add custom attributes to a location, however you will have to use them somehow, as that's totally dependent on the game and cannot really be made generic. My idea is to have a table which defines which stats locations contains, and then another which will have like stat_id, location_id, value which would store those stats per location. A lib file would then make it easier to access those. What do you think?

For a 2D map, to "walk" around, it's certainly possible, but may require some time to make it of any value.

Link to comment
Share on other sites

I think that would be awesome. Something that personalizes the system would make it more powerful. It doesn't have to be a 2-d map like NEAB.

I intend on starting with a stock version and worrying about customizations and such as I get time. Last week I had all the time I needed. Now, not so much.

Thank you for listening to me.

Greg

Link to comment
Share on other sites

Okay made some changes which maybe you can add (purpose to add some location interest):

Added 2 tables:

CREATE TABLE `location_master` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `name` varchar(50) DEFAULT NULL,
 `image_url` varchar(250) DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

CREATE TABLE `location_type` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `name` varchar(50) DEFAULT NULL,
 `image_url` varchar(250) DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

 

Changed locations:

CREATE TABLE `locations` (
 `id` int(10) unsigned NOT NULL,
 `name` varchar(80) COLLATE utf8_bin DEFAULT NULL,
 `description` text COLLATE utf8_bin,
 `location_master_id` int(11) DEFAULT NULL,
 `location_type_id` int(11) DEFAULT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

 

locations/lib.php

<?php 
function CurrentPlayerLocation()
{
   $currentLocation = GetUserVariable(playerLocation);
   if ($currentLocation == NULL)
       $currentLocation = GetConfigValue("defaultLocation","locations");
   return $currentLocation;
}

function SetPlayerLocation($location)
{
   SetUserVariable(playerLocation, $location);
}

function CurrentPlayerMasterLocation()
{
   global $db;

   $currentLocation = GetUserVariable(playerLocation);
   if ($currentLocation == NULL)
       $currentLocation = 0;

   $currentMasterLocation = 0;

   $result = $db->Execute("select location_master_id
           from locations
           where id = ?", $currentLocation);
   if ($result->EOF)
   {
       $result->Close();
       return $currentMasterLocation;
   }

   if ($result->fields[0] != NULL)
   {
       $currentMasterLocation = $result->fields[0];
   }

   $result->Close();

   return $currentMasterLocation;
}

function CurrentPlayerLocationType()
{
   global $db;

   $currentLocation = GetUserVariable(playerLocation);
   if ($currentLocation == NULL)
       $currentLocation = 0;

   $currentLocationType = 0;

   $result = $db->Execute("select location_type_id
           from locations
           where id = ?", $currentLocation);
   if ($result->EOF)
   {
       $result->Close();
       return $currentLocationType;
   }

   if ($result->fields[0] != NULL)
   {
       $currentLocationType = $result->fields[0];
   }

   $result->Close();

   return $currentLocationType;
}

 

locations/home_special.php


$result = $db->Execute("select name,description,location_master_id from locations where id = ?", $currentLocation);
$locationName = $result->fields[0];
$locationDescription = $result->fields[1];
$locationMaster = $result->fields[2];
$result->Close();

$result = $db->Execute("select name from location_master where id = ?", $locationMaster);
$locationMasterName = $result->fields[0];
$result->Close();

TableHeader($locationName . ' [' . $locationMasterName . ']', false);

 

Added to wizard_logic:

id name code label_1 label_2 label_3 label_4 label_5 param_1 param_2 param_3 param_4 param_5

34 player in master location CurrentPlayerMasterLocation() == @[email protected] Master Location select id,name from location_master order by name

35 player NOT in master location CurrentPlayerMasterLocation()! == @[email protected] Master Location select id,name from location_master order by name

36 player in location type CurrentPlayerLocationType() == @[email protected] Location Type select id,name from location_type order by name

37 player NOT in location type CurrentPlayerLocationType()! == @[email protected] Location Type select id,name from location_type order by name

Config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="">
<module version="1.0.6" name="Locations" author="Alain Bertrand"
	description="Locations and travel between locations." />
<key name="defaultLocation" description="The default location id (when the player starts)"
	value="1" />
<variable name="playerLocation" />
<table name="locations" />
<table name="location_paths">
	<condition_wizard column="condition_code" />
	<action_wizard column="action_code" />
	<lookup key="id" column="location_id" table="locations"
		display="name" />
	<lookup key="id" column="to_location_id" table="locations"
		display="name" />
	<lookup key="id" column="location_master_id" table="location_master"
		display="name" />
	<lookup key="id" column="location_type_id" table="location_type"
		display="name" />
<table name="location_master" />
<table name="location_type" />
</table>
<theme_table name="locations" />
<theme_table name="location_paths" />
</configuration>

 

Master Location is supposed to be a high level location ... it could be a country over cities (Like Germany with the Locations being Berlin, Bonn, Hamburg).

Location Type is supposed to be a low level location ... it could be docks under city (Like Docks, Business, Apartments under the Location Berlin)

I didn't link the images in (which I find to be crutial for interest), nor the names yet. But I made it work with crimes with the wizard such as:

Crime:

Burn Boat ..... Condition 'player in location type == 1' Location Type 1 = Docks

So Location Berlin connections:

Docks (Location with specialized things to do)

Town Hall (Location with specialized things to do)

Business (Location with specialized things to do)

Residential (Location with specialized things to do)

Each with stuff to do.

Greg

Edited by gmoore
  • Like 1
Link to comment
Share on other sites

this is great im going to add this in now

thanks greg

 

 

 

Okay made some changes which maybe you can add (purpose to add some location interest):

Added 2 tables:

CREATE TABLE `location_master` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `name` varchar(50) DEFAULT NULL,
 `image_url` varchar(250) DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

CREATE TABLE `location_type` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `name` varchar(50) DEFAULT NULL,
 `image_url` varchar(250) DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

 

Changed locations:

CREATE TABLE `locations` (
 `id` int(10) unsigned NOT NULL,
 `name` varchar(80) COLLATE utf8_bin DEFAULT NULL,
 `description` text COLLATE utf8_bin,
 `location_master_id` int(11) DEFAULT NULL,
 `location_type_id` int(11) DEFAULT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

 

locations/lib.php

<?php 
function CurrentPlayerLocation()
{
   $currentLocation = GetUserVariable(playerLocation);
   if ($currentLocation == NULL)
       $currentLocation = GetConfigValue("defaultLocation","locations");
   return $currentLocation;
}

function SetPlayerLocation($location)
{
   SetUserVariable(playerLocation, $location);
}

function CurrentPlayerMasterLocation()
{
   global $db;

   $currentLocation = GetUserVariable(playerLocation);
   if ($currentLocation == NULL)
       $currentLocation = 0;

   $currentMasterLocation = 0;

   $result = $db->Execute("select location_master_id
           from locations
           where id = ?", $currentLocation);
   if ($result->EOF)
   {
       $result->Close();
       return $currentMasterLocation;
   }

   if ($result->fields[0] != NULL)
   {
       $currentMasterLocation = $result->fields[0];
   }

   $result->Close();

   return $currentMasterLocation;
}

function CurrentPlayerLocationType()
{
   global $db;

   $currentLocation = GetUserVariable(playerLocation);
   if ($currentLocation == NULL)
       $currentLocation = 0;

   $currentLocationType = 0;

   $result = $db->Execute("select location_type_id
           from locations
           where id = ?", $currentLocation);
   if ($result->EOF)
   {
       $result->Close();
       return $currentLocationType;
   }

   if ($result->fields[0] != NULL)
   {
       $currentLocationType = $result->fields[0];
   }

   $result->Close();

   return $currentLocationType;
}

 

locations/home_special.php


$result = $db->Execute("select name,description,location_master_id from locations where id = ?", $currentLocation);
$locationName = $result->fields[0];
$locationDescription = $result->fields[1];
$locationMaster = $result->fields[2];
$result->Close();

$result = $db->Execute("select name from location_master where id = ?", $locationMaster);
$locationMasterName = $result->fields[0];
$result->Close();

TableHeader($locationName . ' [' . $locationMasterName . ']', false);

 

Added to wizard_logic:

id name code label_1 label_2 label_3 label_4 label_5 param_1 param_2 param_3 param_4 param_5

34 player in master location CurrentPlayerMasterLocation() == @[email protected] Master Location select id,name from location_master order by name

35 player NOT in master location CurrentPlayerMasterLocation()! == @[email protected] Master Location select id,name from location_master order by name

36 player in location type CurrentPlayerLocationType() == @[email protected] Location Type select id,name from location_type order by name

37 player NOT in location type CurrentPlayerLocationType()! == @[email protected] Location Type select id,name from location_type order by name

Config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="">
   <module version="1.0.6" name="Locations" author="Alain Bertrand"
       description="Locations and travel between locations." />
   <key name="defaultLocation" description="The default location id (when the player starts)"
       value="1" />
   <variable name="playerLocation" />
   <table name="locations" />
   <table name="location_paths">
       <condition_wizard column="condition_code" />
       <action_wizard column="action_code" />
       <lookup key="id" column="location_id" table="locations"
           display="name" />
       <lookup key="id" column="to_location_id" table="locations"
           display="name" />
       <lookup key="id" column="location_master_id" table="location_master"
           display="name" />
       <lookup key="id" column="location_type_id" table="location_type"
           display="name" />
   <table name="location_master" />
   <table name="location_type" />
   </table>
   <theme_table name="locations" />
   <theme_table name="location_paths" />
</configuration>

 

Master Location is supposed to be a high level location ... it could be a country over cities (Like Germany with the Locations being Berlin, Bonn, Hamburg).

Location Type is supposed to be a low level location ... it could be docks under city (Like Docks, Business, Apartments under the Location Berlin)

I didn't link the images in (which I find to be crutial for interest), nor the names yet. But I made it work with crimes with the wizard such as:

Crime:

Burn Boat ..... Condition 'player in location type == 1' Location Type 1 = Docks

So Location Berlin connections:

Docks (Location with specialized things to do)

Town Hall (Location with specialized things to do)

Business (Location with specialized things to do)

Residential (Location with specialized things to do)

Each with stuff to do.

Greg

Link to comment
Share on other sites

Okay, and this is just tables. But what I was thinking for location stats:

 

CREATE TABLE `location_stats` (
 `id` int(10) unsigned NOT NULL,
 `location_id` int(11) DEFAULT NULL,
 `location_master_id` int(11) DEFAULT NULL,
 `location_type_id` int(11) DEFAULT NULL,
 `stat_type` int(10) unsigned NOT NULL DEFAULT '0',
 `value` double DEFAULT '0',
 `max_value` double DEFAULT NULL,
 PRIMARY KEY (`id`,`stat_type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1

CREATE TABLE `location_stat_types` (
 `id` int(10) unsigned NOT NULL,
 `name` varchar(30) DEFAULT NULL,
 `description` varchar(1024) DEFAULT NULL,
 `is_location` bit(1) DEFAULT NULL,
 `is_location_master` bit(1) DEFAULT NULL,
 `is_location_type` bit(1) DEFAULT NULL,
 `initial_value` double DEFAULT '0',
 `max_value` double DEFAULT NULL,
 `min_value` double DEFAULT '0',
 `code_when_min` text,
 `on_change` text,
 `display_code` text,
 `restore_rate` double DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

 

Like users but general for locations.

An example:

Master Stats would show up in every location that had location_master_id = 'Germany'

Location Master [GERMANY]

Stat: Morale [80]

Stat: Power [98]

Location Stats would show up just for a base location

Location [bERLIN]

Stat: Walls [23]

Stat: Airfields [12]

Stat: Large Buildings [12,312]

Location Type Stats would show at any location that had a type and had a location_id not its own (like a part of that location)

Location Type [DOCKS] - In Berlin

Stat: Ships [12]

Stat: Sailors [900]

So I am located in GERMANY at BERLIN at its DOCKS, I might see:

Stat: Morale [80]

Stat: Power [98]

Stat: Walls [23]

Stat: Airfields [12]

Stat: Large Buildings [12,312]

Stat: Ships [12]

Stat: Sailors [900]

 

With appropriate Wizard additions, we can do things like:

Attack (if item='guns' && player_location_type == 'docks' && player_location_type_stat == 'Sailors' && player_location_type_stat_qty > 100).

Too complicated? Or way useful and cool?

Best part is. I was coming up with a location_facility and location_facility_type table but thought I could just use this. That way the mix or craft can only be done at a certain location_type and perhaps the quality of that place could affect a perfect outcome. Like you need Heavy Factories or you need 2000 workers. etc.

lol

Greg

Edited by gmoore
Link to comment
Share on other sites

Oh an while I am PM'ing with a couple members of our NWE community I have come to realize that the strength of NWE is its Wizard logic. The deeper we take it, the more generic we can make the modules and customize them with Wizards.

I also feel like I am suggesting CORE changes. I find YOU to be the only judge of the qualities of those suggestions. You know the system and your goals better than I. I just want to use it as generically as possible with the most flexibility. So feel free to discard my ideas. But I will post them regardless. It may help all of us.

With the things I have suggested here, anyone can make a chess board to a large MMO with customizations and details that won't seem like its 'just another game'. Like NEAB which I don't think you could make 2 games the same. Here, the stock engine, mine would look the same as anyone's.

Game engine priorities:

1) Game 'board'/'world' that can be made unique and simple to complex.

2) Items: Manufacturing, trading, mining, agriculture, selling, buying, using.

3) Characters: Upgradable, trainable, unique.

4) Diplomacy: Reasons to compete and work together or work against.

5) War: The paranoia aspect of coming back day after day to make sure you are alive. Pvp, sabotage etc.

6) Income: Make valid but not game changing reasons to spend money on the game.

NWE fits the bill as best as I can find.

Greg

Edited by gmoore
Link to comment
Share on other sites

Alain, do you want to do a poll of needs. I have had several people pm and email me about the fact that we need a real good location system. So we can make GREAT game systems. What I have done is good (I think) but maybe the map concept might make it excel. Your call sir.

Greg

Link to comment
Share on other sites

Well, making a map walkable like in NEaB is not impossible, however many people here on this forum are still more attracted by a text game. Also think that a 2D map requires art and JS code which may not be so easy for everyone to modify / handle.

I would say, we should first concentrate on the text aspects of the game, and keep the idea of a 2D map which could be added for later on.

Link to comment
Share on other sites

Ok I updated the location module:

1) You may upload images (one image per location), to do so I used the admin_image_upload module to let the admin upload the image. No need to create any entry in the DB.

2) You can define your own stats used by the locations (on the table location_stat_types)

3) You can define then per location the value of each of those stats (on the table location_stats)

On the code part:

1) I expanded the lib which comes with the location module and you have now access to a new class called..... Location (incredible right?)

To load the current location: Location::Current()

To load any other location: Location::Load($locId)

The CurrentPlayerLocation now let you put another userid as optional parameter if you want to retrieve another player (same for SetPlayerLocation)

The Location object then contains all the base attributes (id, name, description) as well as any self defined stats. To access them: $locObject->id or $locObject->mystat;

2) I added the display of the location image in the home_special.php

Let me know what you think about it.

Link to comment
Share on other sites

Thank you Alain. Good work.

Possible error: The SQL script for 1.0.7 didn't seem to run automatically. My system said I had 1.0.6 and was upgrading to 1.0.8. So I have never looked at the update module code, but maybe it skipped the 1.0.7 scripts? Maybe. I just ran it manually.

Wizard: Did you not want to put conditionals into the Wizard logic to use the stats? It just seemed easy to implement.

Thank you again,

Greg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...