Author Topic: Map Database  (Read 6412 times)

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Map Database
« on: April 28, 2008, 07:53:12 PM »
I would like to make a map database similar to the one on teamliquid.net.

It seams most people dont think its a great idea to have a seprate page on the wiki for each of the maps. I still think this is a good idea but in a different format. A project just for the maps.

I would like to design the database first. I would like to store the data in MySQL and the front end would be PHP.

Anyone care to help? Thanks :)

Offline Mez

  • Hero Member
  • *****
  • Posts: 648
Map Database
« Reply #1 on: April 29, 2008, 07:58:53 AM »
Im up for it.

The PHP side I will have to learn, but have 2 people in my house who can help me with this.

Database side wont be a problem

A few ideas.

Are we going to make it so that it will fit in some form of frame, i.e. So it can be added to the website with a line or two of code?
« Last Edit: April 29, 2008, 08:02:55 AM by Mez »

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Map Database
« Reply #2 on: April 29, 2008, 08:49:36 PM »
Well yea we can write it stand-alone first and deal with adding it to the website later. And we wont use frames as they are ugly. But ya it can be put in the body section later on.

I realy like the database over at the teamliquid site. We dont need all the stats about games played on it, just info about the map and what scenarios it has. So one page per .map file and that will list all the .dll's that use that map.

Offline Mez

  • Hero Member
  • *****
  • Posts: 648
Map Database
« Reply #3 on: May 16, 2008, 06:48:09 AM »
Database has been written (Well begun)

SQL dump of current work in progress here:

http://alexmerrick.co.uk/opu/mapdb

(Edit2: Above site currently down)


Anything I have missed / suggestions for improvement will be considered.
(Edit: I know that I have missed off the map size field)


No PHP has been started yet, and probably won't be for a while as I have exams for the next 3 weeks.

Unless someone else wants to have a crack at it
« Last Edit: May 17, 2008, 07:26:35 AM by Mez »

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Map Database
« Reply #4 on: July 14, 2008, 11:25:23 AM »
Database rev0.1:
Quote
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `opu_mapdb`
--

-- --------------------------------------------------------

--
-- Table structure for table `gametypes`
--

CREATE TABLE `gametypes` (
  `id` smallint(2) NOT NULL auto_increment,
  `name` varchar(20) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

--
-- Dumping data for table `gametypes`
--

INSERT INTO `gametypes` (`id`, `name`) VALUES
(9, 'Campaign'),
(10, 'Colony'),
(7, 'Demo'),
(2, 'Land Rush'),
(1, 'Last One Standing'),
(3, 'Midas'),
(5, 'Resource Race'),
(4, 'Spacerace'),
(6, 'Survivor'),
(8, 'Tutorial');

-- --------------------------------------------------------

--
-- Table structure for table `map`
--

CREATE TABLE `map` (
  `id` smallint(6) NOT NULL auto_increment,
  `filename` varchar(6) NOT NULL,
  `name` varchar(50) NOT NULL,
  `numPlayers` smallint(1) NOT NULL default '0',
  `cpuPlayers` smallint(1) NOT NULL,
  `fanMade` tinyint(1) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `filename` (`filename`),
  KEY `name` (`name`,`numPlayers`,`cpuPlayers`,`fanMade`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `map`
--


-- --------------------------------------------------------

--
-- Table structure for table `map_gametypes`
--

CREATE TABLE `map_gametypes` (
  `map_id` smallint(1) NOT NULL COMMENT 'fk: map.id',
  `gameTypes_id` smallint(1) NOT NULL COMMENT 'fk: gameTypes.id',
  `dllFilename` varchar(6) NOT NULL,
  PRIMARY KEY  (`map_id`,`gameTypes_id`),
  KEY `gameTypes_id` (`gameTypes_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `map_gametypes`
--


--
-- Constraints for dumped tables
--

--
-- Constraints for table `map_gametypes`
--
ALTER TABLE `map_gametypes`
  ADD CONSTRAINT `map_gametypes_ibfk_1` FOREIGN KEY (`map_id`) REFERENCES `map` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `map_gametypes_ibfk_2` FOREIGN KEY (`gameTypes_id`) REFERENCES `gametypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

Offline Mez

  • Hero Member
  • *****
  • Posts: 648
Map Database
« Reply #5 on: July 18, 2008, 03:36:41 AM »
Not done anything since i started on this.  Work tires me out.  Might have another crack at this near the end of august