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 6809003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:01:44+00:00 2026-05-26T20:01:44+00:00

(GridWorld as in Collegeboard’s AP exam case study thing) So, I’ve been working on

  • 0

(GridWorld as in Collegeboard’s AP exam case study thing)

So, I’ve been working on this game during my free time for a few years now, and it’s coming along pretty nicely. I have a nice lil’ stick character that runs around in a grid and picks up items and fights monsters and stuff. Now, I think I’m ready to take it to the next level (for as much of a choice as I have anyway, since I kind of need to make a project for my networks class, hah…), and I’m a bit stumped on how to progress.

I’ve made a few programs in the past using ServerSocket, where I have one Server running and several Clients can connect to it and receive messages, but they have all been simple text programs that don’t exchange more than a few Strings. Sockets are what I was thinking of using for this, but I’m not sure how to set it up…

Now, when GridWorld is run, it automagically pops up what looks like a JFrame, which contains the grid and all actors in it. In the main source file that contains all the code for the, uhh, “engine”, if you will, there are basically 2 giant methods: step(), which controls what happens per every unit of time, and keyPressed(), which controls what happens when the user pushes a key. Now, I was thinking that step() for sure needs to be on the server side, and keyPressed() should be on the client side, along with the window (of course—otherwise how will the user be able to see what they’re playing?) The idea is to have the main game that governs all the NPCs’ actions and game calculations to be running only once, on the server, and for multiple clients to be able to connect to it and each have their own character in the game (basically like a mmorpg).

But like, how exactly would I split it up? (Or if that’s even the right way to go?) I’m not even sure on how to pass data back and forth between the server and client(s)—for my simple text programs that I’ve mentioned, I’ve always used PrintWriter and BufferedReader. I found that PrintWriter does have a print() method that accepts any Object, but then how would the BufferedReader receive it? It doesn’t have any method that will read an Object.

So basically, I want to know all the specifics of exactly what the server should do, what the client should do, which libraries I should use, and where to put certain functionality.

  • 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-26T20:01:45+00:00Added an answer on May 26, 2026 at 8:01 pm

    All right, I’ve settled on using Sockets and doing the Serialization stuff myself with ObjectOutputStreams and stuff. I’ve figured out where to put everything, and it’s basically working fine, though I still have the inevitable glitches in the game itself that I’ll need to hammer out. Thanks, Tim 🙂

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

Sidebar

Related Questions

I am trying to do an assignment using Gridworld, a case study put out
So basically I have a GridWorld Project that I'm doing right now in my
I have searched and can't find the assert to this. I know it must
I am doing this AntFarm project for my Java class. This project consists of
I have a task, where I have to calculate optimal policy (Reinforcement Learning -
Given a set of sixteen letters and an English dictionary file, need to find
I'm currently using the A* pathfinding algorithm to calculate a path on an infinite
public Boolean performAction(AppleCollectorAgent agent, data.ActionType action) { if(agent != null && action != null)
I'm experimenting with Canvas, placing tokens of different colors on a grid, and trying
I would like to use tikzDevice to include annotated ggplot2 graphs in a Latex

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.