Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6722687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:28:36+00:00 2026-05-26T09:28:36+00:00

I am developing a php text based game. I am organizing tasks in games.

  • 0

I am developing a php text based game.
I am organizing tasks in games. Basically tasks increase the understanding of the game.

A task is a group of small actions in the game.

For example:

TASK Description: You are required to steal a bike, repair it and ship to another city.

It includes 3 actions.

  1. Steal a bike
  2. Repair the bike
  3. Ship it to another city (let say London)

These 3 actions are possible at single of different pages.

I created a table for TASK(task_id, title, description (TASK Description Above),STATUS), but I’m not sure how to store and execute actions of task.

I have one idea, to use a related table TASK_ACTIONS (task_id, action_id,action(?),done)

But I’m not sure in which form to store actions action(?):

An sql statement to check for actions Like following three points.

  1. Bike has been stolen or not. If yes, Mark action to DONE
  2. Bike has been repaired or still damaged. If repaired, Mark Action DONE
  3. Bike has been shipped to London or not. If shipped, Mark Action DONE

If all above marked DONE then mark TASK STATUS as COMPLETED, show next task.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:28:37+00:00Added an answer on May 26, 2026 at 9:28 am

    A cheap way to do this would look like this:

    tasks
    {
        user_id
        has_theft_bike
        has_repaired_bike
        ... 
    }
    

    However, this is not easy to expand. A more correct way would be to define all actions in an actions table

     actions // defines all possible actions (also actions not part of a task)
     {
          action_id
          description
     }
    
     user_actions // has one record for every action a user commits
     {
          user_id
          action_id
          date // possible extra
     }
    
     tasks // all possible tasks
     {
         task_id
         name
     }
    
     task_actions // all actions linked to a task
     {
         task_id
         action_id
     }
    

    This way you log every action a user does. You could make a steal bike action and a repair bike action.

    Now you can for instance retrieve all actions you need to complete task 5 (steal a bike and repair it). Then if all those action id’s are in the user_actions table for your current user. it means the user has completed the task.

    Just not that your user_actions table will grow really really really fast if you have a couple of users.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been developing a text-based PHP/MySQL RPG Game Engine since early December last year,
I am developing a php-based web application in which there is a text area
I am developing a PHP-based login system. Each user has an ID(a number) and
I'm an engineering student and I'm developing a simple software based on HTML, PHP
I'm developing a PHP-MySQL app that enables registered users to enter text comments. Problem
I am developing for a pre existing PHP based system. I am trying to
So I am just starting out developing PHP web applications and have finished setting
I'm using NetBeans 6.5 for developing PHP and I have xdebug setup. Is there
Currently developing a PHP framework and have ran into my first problem. I need
I'm currently developing a PHP application that's using an Access database as a backend.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.