Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Vapourware MadTV based game

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
So I made a thread asking if anyone was interested in MadTV, didn't get much response but I will start to report progress here anyway.

On Sunday (29/12) I made a little code to generate random maps and yesterday I added a code to transform the map into an image so the game can show the player just the image instead of having to build each element of the map when showing it.

Code:
void PurpleOrangeTV::setWorld(int row, int col, bool waterOnLeftRight, bool waterOnTopBottom, double percertOfPopulation, double percentOfWater)
{
m_row=row;
emit rowChanged();

m_col=col;
emit colChanged();

for (int i=0;i<row;i++)
  for (int j=0;j<col;j++)
   if (waterOnLeftRight && j==0)
    m_worldMap[i][j]=-1;
   else if (waterOnLeftRight && j==col-1)
    m_worldMap[i][j]=-1;

   else if (waterOnTopBottom && i==0)
    m_worldMap[i][j]=-1;
   else if (waterOnTopBottom && i==row-1)
    m_worldMap[i][j]=-1;

   else
    m_worldMap[i][j]=0;

qulonglong seedPoints=row*col*0.05;
qulonglong waterPoints = qFloor(randInt(seedPoints*3,seedPoints*5)*percentOfWater);
if (!waterOnLeftRight && !waterOnTopBottom) waterPoints=0;

while (waterPoints>0)
{
  int x=randInt(0,row-1);
  int y=randInt(0,col-1);
  if ((m_worldMap.contains(x) && m_worldMap[x].contains(y) && m_worldMap[x][y]==0)
   && ((m_worldMap.contains(x-1) && m_worldMap[x-1].contains(y) && m_worldMap[x-1][y]==-1)
    || (m_worldMap.contains(x+1) && m_worldMap[x+1].contains(y) && m_worldMap[x+1][y]==-1)
    || (m_worldMap.contains(x) && m_worldMap[x].contains(y-1) && m_worldMap[x][y-1]==-1)
    || (m_worldMap.contains(x) && m_worldMap[x].contains(y+1) && m_worldMap[x][y+1]==-1) ))
  {
   m_worldMap[x][y]=-1;
   waterPoints--;
  }
}

while (seedPoints>0)
{
  int x=randInt(0,row-1);
  int y=randInt(0,col-1);
  if (m_worldMap[x][y]==0)
  {
   m_worldMap[x][y]=100;
   seedPoints--;
  }
}

qulonglong popPoints=qFloor(row*col*20*percertOfPopulation);

while (popPoints>0)
{
  int x=randInt(0,row-1);
  int y=randInt(0,col-1);
  if ((m_worldMap.contains(x) && m_worldMap[x].contains(y) && m_worldMap[x][y]==0)
   && ((m_worldMap.contains(x-1) && m_worldMap[x-1].contains(y) && m_worldMap[x-1][y]>0)
    || (m_worldMap.contains(x+1) && m_worldMap[x+1].contains(y) && m_worldMap[x+1][y]>0)
    || (m_worldMap.contains(x) && m_worldMap[x].contains(y-1) && m_worldMap[x][y-1]>0)
    || (m_worldMap.contains(x) && m_worldMap[x].contains(y+1) && m_worldMap[x][y+1]>0) ))
  {
   QList<int> aux;
   if (m_worldMap.contains(x-1) && m_worldMap[x-1].contains(y) && m_worldMap[x-1][y]>0) aux<<m_worldMap[x-1][y];
   if (m_worldMap.contains(x+1) && m_worldMap[x+1].contains(y) && m_worldMap[x+1][y]>0) aux<<m_worldMap[x+1][y];
   if (m_worldMap.contains(x) && m_worldMap[x].contains(y-1) && m_worldMap[x][y-1]>0) aux<<m_worldMap[x][y-1];
   if (m_worldMap.contains(x) && m_worldMap[x].contains(y+1) && m_worldMap[x][y+1]>0) aux<<m_worldMap[x][y+1];

   double value=0;
   for (int i=0;i<aux.count();i++)
    value+=aux[i];
   value/=aux.count();

   m_worldMap[x][y]=qFloor(value)-randInt(5,25);
   if (m_worldMap[x][y]<0) m_worldMap[x][y]=0;

   if (m_worldMap[x][y]>popPoints)
    popPoints=0;
   else
    popPoints-=m_worldMap[x][y];
  }
}

for (int i=0;i<row;i++)
{
  QStringList aux;
  for (int j=0;j<col;j++)
   aux<<QVariant(m_worldMap[i][j]).toString();

  setNewWorldLine(aux);
}

m_worldMapImage=QPixmap(col*m_mapBlockSize,row*m_mapBlockSize);
m_worldMapImage.fill(QColor("#d3a665"));
QPainter painter(&m_worldMapImage);

for (int i=0;i<row;i++)
{
  for (int j=0;j<col;j++)
  {
   painter.setOpacity(1);
   painter.setPen(QColor("#2c3e8b"));
   painter.setBrush(QColor("#2c3e8b"));
   if (m_worldMap[i][j]>-1)
   {
    painter.setPen(QColor("#d20606"));
    painter.setBrush(QColor("#d20606"));
    painter.setOpacity((double)m_worldMap[i][j]/100.0);
   }

   painter.drawRect(j*m_mapBlockSize,i*m_mapBlockSize,m_mapBlockSize-1,m_mapBlockSize-1);
   if (m_worldMap[i][j]==-1)
   {
    double opacity=(double)randInt(2,5)/10.0;
    painter.setOpacity(opacity);
    painter.setPen(QColor("#005952"));
    painter.setBrush(QColor("#005952"));
    painter.drawRect(j*m_mapBlockSize,i*m_mapBlockSize,m_mapBlockSize-1,m_mapBlockSize-1);
   }
  }
}
}

The code is really simple, I just wanted to do something fast that could give a reasonable result.

Yesterday I made the qml part as to display the map on a window regardless of the map size, zoom in, zoom out and drag.

Some parameters you can enter when creating the map:
MapCreation.png


A 20x30 map, the value goes from 100 to 0, 100 being maximum population for a point (square) of the map.
Water is -1.
Map20x30.png


A bigger map without water, 60x90:
Map60x90_NoWater.png


A map with zoom applied:
Map60x90_NoWater_Zoom.png



The american version of MadTV had a USA map while the original german version had a Germany map.
Since I want all aspects of the game to be randomized, I thought it would be great to start with random maps.

Now I will create random categories for the movies tweak the map to also tell how much each point likes each category.

So when you want to buy a new tower, you will not only want to maximize population but also to find an area where they like the categories that you use more often.

Feel free to talk about the game MadTV or give suggestion, critic to this project.

EDIT: Here is a great faq about MadTV http://www.gamefaqs.com/pc/581730-mad-tv/faqs/38558

EDIT2: Source code: http://git.purpleorangegames.com/purpleorangetv
 
Last edited:

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Making the hover the map part.
For now it's displaying just information about one point, I will make it return the average of the green area.
Also, make it possible to edit the size of the area.

MapHover.png
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Finishing the map part.
Like the original game, it gives one station at the start with 5m viewers, here the game looks for 5m spots and gives one to the player.
It tries to generate a map with at least 4 spots for now.

MapHoverPopulationNewPrice.png


Now I need to make the code which excludes the new viewers from the mouse hover for stations that you already have.
For example if you try to buy a station too close to your own (blue in the map) you can't count the population of the intersection twice.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Done the first configuration screen, I'm going to add stuff to the categories, movies and opponents screen. But AI won't be in now.
This way the player can choose to put his own names and descriptions to the categories and movies.
He can randomly generate them before starting the game, edit and also export/import.

TVConfiguration.png
 
Self-Ejected

Yuri Gagarin

Self-Ejected
Joined
Nov 2, 2013
Messages
268
Interesting project, but I wonder. What happened to Starlife? It's been abandoned and you will work with this game? I never heard of MadTV by the way.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Not abandoned, part of the code of these new projects will be used in StarLife, it's more like a vacation from it.
We want to work on some simple games before we continue on the massive work that is StarLife.

This project will also let me work and study AI that I will definitely reuse it on all other projects.
I'm also experimenting a game engine for Qt, it would be hard to change StarLife right now to use it just to discover later that it was a waste of time, so I'm testing V-Play 2 on this project.

Most of the service and planet management of StarLife was based on MadTV and King of Dragon Pass, it's a game that I really enjoy even today.
I like it because it's very simple: buy movies, choose adverts, plan your schedule and reorganize as necessary.
Even though it is a repetitive task the game is able to make you want to play just one more day, and then another one.. it's really hard to stop.

EDIT: You should try it, it works ok on dosbox, the mouse lags a bit, I found that on 4000 cycles and 150 mouse sensitivity you almost forget the mouse issue.
And I just love the turbo button on dosbox, it really helps on MadTV since you have to walk from one place to another inside the building.
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
On categories you can now choose how many of them will be used on the game.
You can set up a name, a description, how many days it takes for a movie to recover after being aired. As in if you just aired a movie and try it again nobody will want to watch it since they just watched it or watched it recently.
On MadTV if I'm not wrong Comedy would take a lot less days to recover than for example Epic category.
Then you can choose what group of viewers likes that category, I have divided it in three groups Teen, Adult and Elder. I will probably customize this too later so you can have more groups.

The randomize button will randomize Days to Recover and the groups who likes the category. Not the name or description yet.

TVCategories.png
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
Just finished the Time Frame (don't know if the name is ok), there you can set what is the best hour for the people groups and also for categories.
You can also set how much hours per day you are able to manage, in MadTV you can schedule from 18:00 to 00:00, at 17:00 you arrive to work and 01:00 you leave the building.

TVTimeFrameConfiguration.png
 

tiagocc0

Arcane
Joined
Jun 29, 2007
Messages
2,056
Location
Brazil
I was planning game mechanics and thinking about how to proceed with it since the game won't have movement and won't be realtime as the original.

What I came up with is this:

Make it like a boardgame, the turn is divided into phases.
At the start of the you will get the buy/sell phase where you can buy/sell movies and stations.
Then comes the advertising phase where you can pick up what adverts you want.
In those two phases all players (human and ai) will pick up what they want, if the pick the same thing then probably an auction will happen for movies or stations on the same place. For adverts you can lower how much you will gain or decrease the days you have to display it or increase the number of viewers (in resume you make it more appealing for the client) and however makes the best deal gets the advert.

Then comes planning.
The idea here is to plan the whole day and you get one chance to change something.
So let's say you place all your programs and adverts and everything works fine, the day will end without stopping.
On the next day one of your adverts isn't going to get the minimum amount of viewers necessary, so the game stops at that hours giving you an opportunity to change the advert.
The same could happen, if you set it to be that way (as an checkbox) if you want it to stop when the amount of viewers is too big for that advert (meaning you could earn more money by replacing it with a better advert which requires more viewers).

The comes the result phase where you can see how each player fared.

For this to happen the player would be able to get an estimative of how their planning would work. With an error margin.


Then comes the other part of the mechanics which would make it an light rpg. You could have skills that could give you:
-More chances of stopping when an advert isn't going to work.
-Better estimative of your planning.
-Better prices for movies/stations.
-Better advert conditions.
-Be able to sabotage other players (haven't thought about it yet)
-Be able to espionage other player plans.
-Better custom programs (when you make your own series/shows/live events)

And any other aspect of the game that could be used as a skill.

I'm going to refine all those ideas.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom