Vishwas
Vishwas

Reputation: 1541

Suitable framework for text based games as shown in the video

First of all, i am not sure if such games come under "Text based games". Previously when i asked same question, i remained with doubts that probably, my question was misunderstood. Might be because of the wrong terminology i am using. So added up a video for a dummy game aimed to be built.

The game is about, competing in the "TV world" by creating more and more successful programs. It also involves planning them, hiring tv actors, managing funds etc. ( Something similar on the lines of Hollywood Mogul)

www.youtube.com/watch?v=D8C3kJ4CraQ

I tried to code the above game using MVC. However, as and as i coded, i ended up myself with a huge number of "view" classes, which was very hard to manage especially because in this particular scenario, every step take in the view, is dependent upon the another view. That is to say, there is a lot and lot of validation on each and every step.

For example, if i click on some tab, coming on the later stages of the game, it validates the data (model) collected by other prior views. This makes it very hard to code. As already the validations jumble up together, in addition to the long route followed by MVC to validate views.

Any ideas, experience shared would be appreciated. Thanks :)

Upvotes: 0

Views: 118

Answers (1)

Kodiak
Kodiak

Reputation: 5978

The views should depend on the model, not on other views. For instance, the warning "Please specify the roles first" should occur because the model lacks the roles, not because the roles view has not been validated.

Therefore yours views should be hierarchical. You will have a main view including the top menu, for each item another view including the secondary menu and a view per form. Each form view will fill a part of the model directly. The forms views should not include the menus. There, the conditionnal validations for the top menu would only be put in your top view and so forth.

I hope this all makes sense and helps you.

Upvotes: 1

Related Questions