Welcome, Guest
Username Password: Remember me

JIGS- Featuring The Eclectic Meme Conspiracy
(1 viewing) (1) Guest

TOPIC: JIGS- Featuring The Eclectic Meme Conspiracy

JIGS- Featuring The Eclectic Meme Conspiracy 1 year, 1 month ago #181

  • Techbot
  • OFFLINE
  • Web Designer, DJ, Assasin
  • Karma: 1
Today We've launched http://www.eclecticmeme.com based on the proof of concept : JIGS - (Joomla Interactive Game System).

Feel free to hop over and register and then come back to submit your ideas for the game here.



The idea is to build a game engine that can be configured by a sysadmin to morph from a trading game to a mafia style browser game even chess or pacman depending on the plugins installed and the tweaking by the sysadmin.

It will be based around joomla 1.5 for the moment and will use NoixACL , Community Builder and maybe Kunena forums. Once we've got a beta up we will start looking at making it compatible with other 3rd part joomla extensions. Maybe using the nooku framework and/or joomla 1.6.

The source code will be available immediately via github. We will not be putting the component up onto the JED until after we get a security audit from a third party developer. Until then download and install at your own risk.

This project is based on completely original code, we dropped the idea of building on the previous browser game that we were attempting to translate from French. Instead I've spent the past few months studying javascript to complement my php/mysql skills, so we can develop both the front and back end code to our liking.

The conspiracy will be based on the online book/soap opera of the same name and is a result of several years writing tales and collaborating with other post modernist sci-fi hacks. The audio and visuals will be supplied by EMC23.com and will be released under a creative commons licence.
And of course we are looking for anyone interested in this huge multimedia project/ online game .
Last Edit: 1 year, 1 month ago by IJUG.

Re: JIGS- Featuring The Eclectic Meme Conspiracy 1 year, 1 month ago #182

  • Techbot
  • OFFLINE
  • Web Designer, DJ, Assasin
  • Karma: 1
I've added the code to github

github.com/Techbot/JIGS



Initiial Upload:

1) Basic Joomla list view and record view. The code is based on the tutorials in "Learning Joomla! 1.5 - extension Development" by J Le Blanc. I highly recommend it to anyone beginning to code for Joomla!. The data was ported from Mafia Job 6.

This was used to create the people, cars, buildings and players tables/views

2) A php loop within a loop that reads 8 rows from a table and creates a 64 celled map.
<?php
	for ($y=0;  $y <= 7 ; $y++) {
		$name='row'.$y;
		$arr[$y] = explode(",",($this->row->$name));
		$x = 0;
		foreach ($arr[$y] as $row){
			?>
<script type='text/javascript'>
cell[<?php echo $x ;?>][<?php echo $y ;?>]=<?php echo $row ; ?>;
</script>
<div class="squares" style="
background:url(<?php echo $this->baseurl; ?>/components/com_battle/images/map/<?php echo $row ?>.jpg);
display:inline; 
position:absolute; 
width:40px; 
height:40px; 
padding:5px;
margin:0px;
text-align:center;
top:<?php echo ($y*50)+0?>px; 
left: <?php echo $x*50?>px;
"> 
<?php echo $row ?></div>
<?php	
$x= $x+1;
	}
}
?>


3) A javascript loop to catch the four arrow key key presses. (or the simple on click html links)
function check(e){
	if (!e) var e = window.event;
		(e.keyCode) ? key = e.keyCode : key = e.which;
//	alert (key);
	try{
		switch(key){
			case 37: MoveLeft(); break; 	//left
			case 38: MoveUp(); break; 	//up
			case 39: MoveRight(); break; 	//right
			case 40: MoveDown(); break; //down
		}
		
	}catch(Exception){}
}


4) A Scriptalicious On load function that moves the main div called 'demo' in increments of 50: up down left and right. depending on the key press events.

Event.observe(window, 'load', function() {
	new Effect.Move('demo', { x: pX, y: pY});
 	new Effect.Appear('demo', { duration: 8.0 });
	check_world();
	return;
		}

);
Last Edit: 1 year, 1 month ago by Techbot.

Re: JIGS- Featuring The Eclectic Meme Conspiracy 1 year, 1 month ago #185

  • Techbot
  • OFFLINE
  • Web Designer, DJ, Assasin
  • Karma: 1
New Updates:


1) Replaced Prototype with Mootools.

replaced
Event.observe(window, 'load', function() {
	new Effect.Move('demo', { x: pX, y: pY});


with
window.addEvent('domready', function(){
	
	var mover = new Fx.Move($('demo'), {
    relativeTo: $('grid'),
    position: 'upperLeft',
    edge: 'upperLeft',
  offset: {x: pX, y: pY}
  });
  
 mover.start(); //moves to the new location
	check_world()
});


This reduces the size of the javascript libraries and moves to the officially supported mootools. I only used prototype because it was the first result in google that worked for me when trying to move the main characters div.

One result of this is that pX and pY are absolute values now instead of relative. We'll see what other advantages mootools has to offer over the coming weeks. I particularly like the ability to centre one div over another. This could be a way of clicking on a square and have a character move to that square.

2) Introduced Json to update non-player character positions.

javascript:
function check_world(){

  var a = new Request.JSON({
    url: "index.php?option=com_battle&format=raw&task=listStuff", 
    onSuccess: function(result){ 
    var i=0;
	while (eval(result[i].id) > 0){ 
	Move_Char(result[i].id,result[i].posx,result[i].posy);
	i=i+1;
 }
  }
   }).get();
   
   	get_players();
   
   
} // end if check world



while (eval(result[i].id) > 0 is not cool.

when (eval(result[i].id) runs out we get an error. Need to find alternative loop and clause. (though it works for now).



php (in controller)
function get_players() {

		$db =& JFactory::getDBO();
		$user =& JFactory::getUser();
		$db->setQuery("SELECT map,grid FROM jos_jigs_players WHERE iduser =".$user->id);
		$result = $db->loadRow();
		$map = $result[0];
        $grid = $result[1];		
		$db->setQuery("SELECT jos_jigs_players.iduser, 
				jos_jigs_players.posx, 
				jos_jigs_players.posy, 
				jos_comprofiler.avatar
				
				FROM jos_jigs_players 
				LEFT JOIN jos_comprofiler ON jos_jigs_players.iduser = jos_comprofiler.user_id
				WHERE grid ='".$grid."' AND map='".$map."' AND jos_jigs_players.iduser !='".$user->id."'
						
						");
				
		$result = $db->loadAssocList();
		echo Json_encode($result);
}




3) Introduced Grids.
A grid is made up of 1,4,9 or 16 maps (or 1*1 ,2*2 ,3*3, or 4*4 . (n*n where n is called the grid_index)
A map is made up of 64 cells or tile spaces.

To move from map to map simply involves increasing or decreasing the map id by one if moving left to right . To move up or down from a map you increment the map id by the grid_index.

To move from grid to grid involves the use of portals. there will be three types of portal

A) Magical portals, part of the game story eg a portal at Newgrange or Egyptian pyramid.
An story portal eg The entrance to a tunnel, a bus depot , a train station.
C) A non story portal (as in the picture below) simply joins one part of a city to another unknown to the players.

All three function identically from a code point of view. I've added some code and grid columns to the players database table, but haven't actually introduced the portal code to the game yet. It is the next high priority task.



4) Introduced Community Builders Profile Page and avatars.


Changes have been uploaded to both the eclecticmeme.com and Github: https://github.com/Techbot/JIGS


The github files are still a bit disorganised and probably not to be trusted. It might take a week or so for things to settle into a routine
Last Edit: 1 year, 1 month ago by Left.

Re: JIGS- Featuring The Eclectic Meme Conspiracy 1 year, 1 month ago #188

  • Techbot
  • OFFLINE
  • Web Designer, DJ, Assasin
  • Karma: 1
1) Added multiplayer functionality.
there are now three function calls to update each of the types

a) player
b) other players
c) NPCs

b) is essentially all players online minus main character.

I considered removing a) and changing b) to not remove the main character i.e: where x != $Juser->id

This would have reduced the code by one loop however it felt clunky. This is especially true if I want to separate as much as possible into plugins at a later stage

2) Added a plugin that creates the default game settings for a player on registration. This will need to be updated to include updates not just inserts.
Also it uses $mainframe which has been deprecated. It will be necessary to change this when we move to joomla 1.6
Last Edit: 1 year, 1 month ago by Left.

Re: JIGS- Featuring The Eclectic Meme Conspiracy 1 year, 1 month ago #192

  • Techbot
  • OFFLINE
  • Web Designer, DJ, Assasin
  • Karma: 1
1) Added the ability to attack non player characters NPCs. The attack system is little more than a dice roll. Two random numbers are picked: one for the player and one for the NPC. Whoever has the highest takes a strength point from the loser.

 $player_dice= rand(0, 15);
	    $character_dice=rand(0, 5);
           if ($player_dice > $character_dice){
	    	$player_v=$player_v+1;
	    	$char_v=$char_v-1;
	    	}
	else {
		
		$player_v=$player_v-1;
		$char_v=$char_v+1;
	}


This is just a simple routine to prepare for later. I intend to build a system based on JAGS revised. But we'll deal with that later.

2) I use Joomla's implementation of lightbox called Squeezebox. I've used tmpl=component in the link to the lighbox to remove the template. Normally I would have used Format=raw but format=raw generated the template while format=raw (small f) generated a view not found error. Really odd. I'll need to investigate this later.

<a rel="SqueezeBox" href="index.php?option=com_battle&view=person&tmpl=component&id=<?php echo $char?>" title="caption" width="50" class="modal">



Thanks to Lisa who put together a self contained 'downtown' to get the actual game kick started. See her blog on it on Tile-based Computer Game Design Part I on www.emc23.com
Last Edit: 1 year, 1 month ago by Left.

Re: JIGS- Featuring The Eclectic Meme Conspiracy 1 year ago #262

  • Techbot
  • OFFLINE
  • Web Designer, DJ, Assasin
  • Karma: 1
It's been over a month since my last update! That's largely coz of the meetup and the responsibilities of real life.

But I did get some coding done.

Added the abiliy to kill an NPC. ( Non PLayer Character)
This is straight -forward stuff so I won't bother with any code. After each attack round is initiated via a JSON call, the call returns the players and NPCs health which is alert'ed. If the NPC's health is equal to or less than zero the player gets the NPC's loot and the NPC's active setting in the database is set to zero. When the resulting JSon Health scores are returned to the Javascript front end the NPC's health is again checked if it is equal to zero and if so the page is reloaded. Because the NPC is now not active , the NPC is no longer displayed.

Added the ability to buy and sell objects at a Store.
Straight forwards Json calls. Php checks if user has enough money for object (which is same for all items at the moment), then changes ownership of item in a table dedicated to every instance of an object.


I have a few issues at this stage.
If you click on a second NPC it shows the info for the previous NPC in the modal window. I cannot figure out why and am having very little luck on the forums, both Joomla and Mootools.
This is a link to a dynamic page that should pop up in a squeezebox


<a rel="SqueezeBox" href="index.php?option=com_battle&view=person&tmpl=component&id=<?php echo $char?>" title="<?php echo $char_name?>" width="50"  class="modal">




When run I get links like

www.eclecticmeme.com/index.php?option=co...omponent&id=3004

www.eclecticmeme.com/index.php?option=co...omponent&id=3002

Both these links are clearly different yet once one is clicked its page is cached and all subsequent squeezeboxes display the same info until I reload.

This also happens if the view is different to eg

www.eclecticmeme.com/index.php?option=co...component&id=100

When clicked outside of a squeezebox they work as expected.

However when accessed in a squeezebox, I end up with the same content in each

I have made a page to demonstrate this.
www.eclecticmeme.com/index.php?option=com_battle&view=test

The three links 3002 ,3004 and Building 100 are called using the following code
<a rel="SqueezeBox" href="index.php?option=com_battle&view=person&tmpl=component&id=3002" title="3002" width="50"  class="modal">3002</a>
<a rel="SqueezeBox" href="index.php?option=com_battle&view=person&tmpl=component&id=3004" title="3004" width="50"  class="modal">3004</a>
<a rel="SqueezeBox" href="index.php?option=com_battle&view=building&tmpl=component&id=100" title="3004" width="50"  class="modal">Building100</a>

Each link shows the content of whatever link is chosen first.

Note if you reload and click a different link first you will get different content.
Last Edit: 12 months ago by Left.
Time to create page: 0.46 seconds